changeset 20413:fd7b501cc9c8

fix up broken merge
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 12 May 2007 19:35:18 +0000
parents 522f618a44b4
children 76e736b59aa4
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 7 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sat May 12 19:19:55 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat May 12 19:35:18 2007 +0000
@@ -906,6 +906,7 @@
 		{
 			char *body_str, *body_enc, *pre, *post;
 			const char *format;
+			MsnIMData *imdata = g_new0(MsnIMData, 1);
 			/*
 			 * In MSN, you can't send messages to yourself, so
 			 * we'll fake like we received it ;)
@@ -923,8 +924,12 @@
 			g_free(post);
 
 			serv_got_typing_stopped(gc, who);
-			serv_got_im(gc, who, body_str, flags, time(NULL));
-			g_free(body_str);
+			imdata->gc = gc;
+			imdata->who = who;
+			imdata->msg = body_str;
+			imdata->flags = flags;
+			imdata->when = time(NULL);
+			g_idle_add(msn_send_me_im, imdata);
 		}
 
 		msn_message_destroy(msg);
@@ -946,37 +951,6 @@
 								   friendname, who,	message);
 		msn_oim_send_msg(oim);
 	}
-	else
-	{
-		char *body_str, *body_enc, *pre, *post;
-		const char *format;
-		MsnIMData *imdata = g_new0(MsnIMData, 1);
-		/*
-		 * In MSN, you can't send messages to yourself, so
-		 * we'll fake like we received it ;)
-		 */
-		body_str = msn_message_to_string(msg);
-		body_enc = g_markup_escape_text(body_str, -1);
-		g_free(body_str);
-
-		format = msn_message_get_attr(msg, "X-MMS-IM-Format");
-		msn_parse_format(format, &pre, &post);
-		body_str = g_strdup_printf("%s%s%s", pre ? pre :  "",
-								   body_enc ? body_enc : "", post ? post : "");
-		g_free(body_enc);
-		g_free(pre);
-		g_free(post);
-
-		serv_got_typing_stopped(gc, who);
-		imdata->gc = gc;
-		imdata->who = who;
-		imdata->msg = body_str;
-		imdata->flags = flags;
-		imdata->when = time(NULL);
-		g_idle_add(msn_send_me_im, imdata);
-	}
-
-	msn_message_destroy(msg);
 
 	return 1;
 }