# HG changeset patch # User Sean Egan # Date 1170581793 0 # Node ID d74985add99fe3dc0778ac292f024bfccd29159c # Parent 16845e318249ec0d69e5b35c99a17e4ff93ce328 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist diff -r 16845e318249 -r d74985add99f libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sun Feb 04 08:25:43 2007 +0000 +++ b/libpurple/protocols/msn/msn.c Sun Feb 04 09:36:33 2007 +0000 @@ -479,16 +479,6 @@ return "msn"; } -static const char* -msn_list_emblem(GaimBuddy *b) -{ - MsnUser *user; - user = b->proto_data; - if (user && user->mobile) - return "mobile"; - return NULL; -} - static char * msn_status_text(GaimBuddy *buddy) { @@ -576,7 +566,11 @@ status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, NULL, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, status); - + + status = gaim_status_type_new_full(GAIM_STATUS_MOBILE, + "mobile", NULL, FALSE, FALSE, TRUE); + types = g_list_append(types, status); + return types; } @@ -743,12 +737,23 @@ GaimMessageFlags flags) { GaimAccount *account; + GaimBuddy *buddy = gaim_find_buddy(gc->account, who); MsnMessage *msg; char *msgformat; char *msgtext; account = gaim_connection_get_account(gc); + if (buddy) { + GaimPresence *p = gaim_buddy_get_presence(buddy); + if (gaim_presence_is_status_primitive_active(p, GAIM_STATUS_MOBILE)) { + char *text = gaim_markup_strip_html(message); + send_to_mobile(gc, who, text); + g_free(text); + return; + } + } + msn_import_html(message, &msgformat, &msgtext); if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) @@ -1930,7 +1935,7 @@ NULL, /* protocol_options */ {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */ msn_list_icon, /* list_icon */ - msn_list_emblem, /* list_emblems */ + NULL, /* list_emblems */ msn_status_text, /* status_text */ msn_tooltip_text, /* tooltip_text */ msn_status_types, /* away_states */ diff -r 16845e318249 -r d74985add99f libpurple/protocols/msn/user.c --- a/libpurple/protocols/msn/user.c Sun Feb 04 08:25:43 2007 +0000 +++ b/libpurple/protocols/msn/user.c Sun Feb 04 09:36:33 2007 +0000 @@ -81,8 +81,15 @@ account = user->userlist->session->account; - if (user->status != NULL) - gaim_prpl_got_user_status(account, user->passport, user->status, NULL); + if (user->status != NULL) { + if (!strcmp(user->status, "offline") && user->mobile) { + gaim_prpl_got_user_status(account, user->passport, "available", NULL); + gaim_prpl_got_user_status(account, user->passport, "mobile", NULL); + } else { + gaim_prpl_got_user_status(account, user->passport, user->status, NULL); + gaim_prpl_got_user_status_deactive(account, user->passport, "mobile"); + } + } if (user->idle) gaim_prpl_got_user_idle(account, user->passport, TRUE, -1);