comparison libpurple/protocols/msn/msn.c @ 15541:d74985add99f

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
author Sean Egan <seanegan@gmail.com>
date Sun, 04 Feb 2007 09:36:33 +0000
parents 0b6f337a46d5
children 1d0d25848c5d
comparison
equal deleted inserted replaced
15540:16845e318249 15541:d74985add99f
477 msn_list_icon(GaimAccount *a, GaimBuddy *b) 477 msn_list_icon(GaimAccount *a, GaimBuddy *b)
478 { 478 {
479 return "msn"; 479 return "msn";
480 } 480 }
481 481
482 static const char*
483 msn_list_emblem(GaimBuddy *b)
484 {
485 MsnUser *user;
486 user = b->proto_data;
487 if (user && user->mobile)
488 return "mobile";
489 return NULL;
490 }
491
492 static char * 482 static char *
493 msn_status_text(GaimBuddy *buddy) 483 msn_status_text(GaimBuddy *buddy)
494 { 484 {
495 GaimPresence *presence; 485 GaimPresence *presence;
496 GaimStatus *status; 486 GaimStatus *status;
574 types = g_list_append(types, status); 564 types = g_list_append(types, status);
575 565
576 status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, 566 status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE,
577 NULL, NULL, FALSE, TRUE, FALSE); 567 NULL, NULL, FALSE, TRUE, FALSE);
578 types = g_list_append(types, status); 568 types = g_list_append(types, status);
579 569
570 status = gaim_status_type_new_full(GAIM_STATUS_MOBILE,
571 "mobile", NULL, FALSE, FALSE, TRUE);
572 types = g_list_append(types, status);
573
580 return types; 574 return types;
581 } 575 }
582 576
583 static GList * 577 static GList *
584 msn_actions(GaimPlugin *plugin, gpointer context) 578 msn_actions(GaimPlugin *plugin, gpointer context)
741 static int 735 static int
742 msn_send_im(GaimConnection *gc, const char *who, const char *message, 736 msn_send_im(GaimConnection *gc, const char *who, const char *message,
743 GaimMessageFlags flags) 737 GaimMessageFlags flags)
744 { 738 {
745 GaimAccount *account; 739 GaimAccount *account;
740 GaimBuddy *buddy = gaim_find_buddy(gc->account, who);
746 MsnMessage *msg; 741 MsnMessage *msg;
747 char *msgformat; 742 char *msgformat;
748 char *msgtext; 743 char *msgtext;
749 744
750 account = gaim_connection_get_account(gc); 745 account = gaim_connection_get_account(gc);
746
747 if (buddy) {
748 GaimPresence *p = gaim_buddy_get_presence(buddy);
749 if (gaim_presence_is_status_primitive_active(p, GAIM_STATUS_MOBILE)) {
750 char *text = gaim_markup_strip_html(message);
751 send_to_mobile(gc, who, text);
752 g_free(text);
753 return;
754 }
755 }
751 756
752 msn_import_html(message, &msgformat, &msgtext); 757 msn_import_html(message, &msgformat, &msgtext);
753 758
754 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) 759 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
755 { 760 {
1928 OPT_PROTO_MAIL_CHECK, 1933 OPT_PROTO_MAIL_CHECK,
1929 NULL, /* user_splits */ 1934 NULL, /* user_splits */
1930 NULL, /* protocol_options */ 1935 NULL, /* protocol_options */
1931 {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */ 1936 {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */
1932 msn_list_icon, /* list_icon */ 1937 msn_list_icon, /* list_icon */
1933 msn_list_emblem, /* list_emblems */ 1938 NULL, /* list_emblems */
1934 msn_status_text, /* status_text */ 1939 msn_status_text, /* status_text */
1935 msn_tooltip_text, /* tooltip_text */ 1940 msn_tooltip_text, /* tooltip_text */
1936 msn_status_types, /* away_states */ 1941 msn_status_types, /* away_states */
1937 msn_blist_node_menu, /* blist_node_menu */ 1942 msn_blist_node_menu, /* blist_node_menu */
1938 NULL, /* chat_info */ 1943 NULL, /* chat_info */