# HG changeset patch # User Elliott Sales de Andrade # Date 1229310098 0 # Node ID 939d173b68b3fdde4188d9084e6df84947ef2b71 # Parent fbd1a82247bac1a5cb88500fe96e9dce69cf0827# Parent 84aabca8413a657f2ef48f13063716fb98c750b6 merge of '44bc6927617b36912dc84306fe8d80a6a9b942a3' and 'f15af3ccd3ef73a41e49e9ed402e23b47801cc67' diff -r 84aabca8413a -r 939d173b68b3 libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Mon Dec 15 02:46:20 2008 +0000 +++ b/libpurple/protocols/msn/oim.c Mon Dec 15 03:01:38 2008 +0000 @@ -616,7 +616,7 @@ /* Match number to user's mobile number, FROM is a phone number if the other side pages you using your phone number */ - if (!strncmp(passport, "tel:+", 5)) { + if (!strncmp(from, "tel:+", 5)) { MsnUser *user = msn_userlist_find_user_with_mobile_phone( rdata->oim->session->userlist, from + 4); @@ -630,13 +630,16 @@ msn_message_get_attr(message, "boundary")); tokens = g_strsplit(message->body, boundary, 0); - for (part = tokens; *part != NULL; part++) { + /* tokens+1 to skip the "This is a multipart message..." text */ + for (part = tokens+1; *part != NULL; part++) { MsnMessage *multipart; + const char *type; multipart = msn_message_new(MSN_MSG_UNKNOWN); msn_message_parse_payload(multipart, *part, strlen(*part), MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM); - if (!strcmp(msn_message_get_content_type(multipart), "text/plain")) { + type = msn_message_get_content_type(multipart); + if (type && !strcmp(type, "text/plain")) { decode_msg = (char *)purple_base64_decode(multipart->body, &body_len); msn_message_destroy(multipart); break;