comparison libpurple/protocols/msn/msn.c @ 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 0f6747c5dcc2
comparison
equal deleted inserted replaced
20412:522f618a44b4 20413:fd7b501cc9c8
904 } 904 }
905 else 905 else
906 { 906 {
907 char *body_str, *body_enc, *pre, *post; 907 char *body_str, *body_enc, *pre, *post;
908 const char *format; 908 const char *format;
909 MsnIMData *imdata = g_new0(MsnIMData, 1);
909 /* 910 /*
910 * In MSN, you can't send messages to yourself, so 911 * In MSN, you can't send messages to yourself, so
911 * we'll fake like we received it ;) 912 * we'll fake like we received it ;)
912 */ 913 */
913 body_str = msn_message_to_string(msg); 914 body_str = msn_message_to_string(msg);
921 g_free(body_enc); 922 g_free(body_enc);
922 g_free(pre); 923 g_free(pre);
923 g_free(post); 924 g_free(post);
924 925
925 serv_got_typing_stopped(gc, who); 926 serv_got_typing_stopped(gc, who);
926 serv_got_im(gc, who, body_str, flags, time(NULL)); 927 imdata->gc = gc;
927 g_free(body_str); 928 imdata->who = who;
929 imdata->msg = body_str;
930 imdata->flags = flags;
931 imdata->when = time(NULL);
932 g_idle_add(msn_send_me_im, imdata);
928 } 933 }
929 934
930 msn_message_destroy(msg); 935 msn_message_destroy(msg);
931 }else { 936 }else {
932 /*send Offline Instant Message,only to MSN Passport User*/ 937 /*send Offline Instant Message,only to MSN Passport User*/
944 friendname = msn_encode_mime(account->username); 949 friendname = msn_encode_mime(account->username);
945 msn_oim_prep_send_msg_info(oim, purple_account_get_username(account), 950 msn_oim_prep_send_msg_info(oim, purple_account_get_username(account),
946 friendname, who, message); 951 friendname, who, message);
947 msn_oim_send_msg(oim); 952 msn_oim_send_msg(oim);
948 } 953 }
949 else
950 {
951 char *body_str, *body_enc, *pre, *post;
952 const char *format;
953 MsnIMData *imdata = g_new0(MsnIMData, 1);
954 /*
955 * In MSN, you can't send messages to yourself, so
956 * we'll fake like we received it ;)
957 */
958 body_str = msn_message_to_string(msg);
959 body_enc = g_markup_escape_text(body_str, -1);
960 g_free(body_str);
961
962 format = msn_message_get_attr(msg, "X-MMS-IM-Format");
963 msn_parse_format(format, &pre, &post);
964 body_str = g_strdup_printf("%s%s%s", pre ? pre : "",
965 body_enc ? body_enc : "", post ? post : "");
966 g_free(body_enc);
967 g_free(pre);
968 g_free(post);
969
970 serv_got_typing_stopped(gc, who);
971 imdata->gc = gc;
972 imdata->who = who;
973 imdata->msg = body_str;
974 imdata->flags = flags;
975 imdata->when = time(NULL);
976 g_idle_add(msn_send_me_im, imdata);
977 }
978
979 msn_message_destroy(msg);
980 954
981 return 1; 955 return 1;
982 } 956 }
983 957
984 static unsigned int 958 static unsigned int