From: Christian H. <ch...@us...> - 2004-04-14 04:03:22
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10172/src/protocols/msn Modified Files: notification.c Log Message: Patch by shx to make the e-mail notification code in MSN a bit more cautious, and hopefully prevent some of the crashes that people have experienced. Index: notification.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/notification.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -p -r1.95 -r1.96 --- notification.c 13 Apr 2004 16:20:55 -0000 1.95 +++ notification.c 14 Apr 2004 04:03:14 -0000 1.96 @@ -1705,7 +1705,9 @@ email_msg(MsnServConn *servconn, MsnMess MsnSession *session = servconn->session; GaimConnection *gc = session->account->gc; GHashTable *table; - char *from, *subject; + char *from, *subject, *tmp; + + from = subject = NULL; if (strcmp(msg->passport, "Hotmail")) { /* This isn't an official message. */ @@ -1725,14 +1727,23 @@ email_msg(MsnServConn *servconn, MsnMess table = msn_message_get_hashtable_from_body(msg); - from = gaim_mime_decode_field(g_hash_table_lookup(table, "From")); - subject = gaim_mime_decode_field(g_hash_table_lookup(table, "Subject")); + tmp = g_hash_table_lookup(table, "From"); + if (tmp != NULL) + from = gaim_mime_decode_field(tmp); - gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user), - session->passport_info.file, NULL, NULL); + tmp = g_hash_table_lookup(table, "Subject"); + if (tmp != NULL) + subject = gaim_mime_decode_field(tmp); - g_free(from); - g_free(subject); + if (from != NULL && subject != NULL) + gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user), + session->passport_info.file, NULL, NULL); + + if (from != NULL) + g_free(from); + + if (subject != NULL) + g_free(subject); g_hash_table_destroy(table); |