608
609
MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
609
610
purple_debug_info("msn", "oim body:{%s}\n", message->body);
611
if (!strcmp(msn_message_get_attr(message, "X-OIMProxy"), "MOSMS")) {
612
boundary = msn_message_get_attr(message, "boundary");
614
if (boundary != NULL) {
615
from = msn_message_get_attr(message, "X-OIM-originatingSource");
617
/* Match number to user's mobile number, FROM is a phone number
618
if the other side pages you using your phone number */
619
if (!strncmp(from, "tel:+", 5)) {
620
MsnUser *user = msn_userlist_find_user_with_mobile_phone(
621
rdata->oim->session->userlist, from + 4);
623
if (user && user->passport)
624
passport = g_strdup(user->passport);
626
if (passport == NULL)
627
passport = g_strdup(from);
629
boundary = g_strdup_printf("--%s" MSG_OIM_LINE_DEM,
630
msn_message_get_attr(message, "boundary"));
631
tokens = g_strsplit(message->body, boundary, 0);
618
bounds = g_strdup_printf("--%s" MSG_OIM_LINE_DEM, boundary);
619
tokens = g_strsplit(message->body, bounds, 0);
633
621
/* tokens+1 to skip the "This is a multipart message..." text */
634
622
for (part = tokens+1; *part != NULL; part++) {
650
638
g_strfreev(tokens);
653
641
if (decode_msg == NULL) {
654
642
purple_debug_error("msn", "Couldn't find text/plain OIM message.\n");
643
msn_message_destroy(message);
647
decode_msg = (char *)purple_base64_decode(message->body, &body_len);
650
from = msn_message_get_attr(message, "X-OIM-originatingSource");
652
/* Match number to user's mobile number, FROM is a phone number
653
if the other side pages you using your phone number */
654
if (from && !strncmp(from, "tel:+", 5)) {
655
MsnUser *user = msn_userlist_find_user_with_mobile_phone(
656
rdata->oim->session->userlist, from + 4);
658
if (user && user->passport)
659
passport = g_strdup(user->passport);
662
if (passport == NULL) {
659
663
char *start, *end;
661
665
from = msn_message_get_attr(message, "From");
662
decode_msg = (char *)purple_base64_decode(message->body, &body_len);
664
667
tokens = g_strsplit(from, " ", 2);
665
668
if (tokens[1] != NULL)