comparison libpurple/protocols/msn/msn.c @ 15463:0b6f337a46d5

Emblems in the blist
author Sean Egan <seanegan@gmail.com>
date Tue, 30 Jan 2007 06:53:23 +0000
parents 42961709cb30
children d74985add99f
comparison
equal deleted inserted replaced
15462:e9c12873fae0 15463:0b6f337a46d5
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 void 482 static const char*
483 msn_list_emblems(GaimBuddy *b, const char **se, const char **sw, 483 msn_list_emblem(GaimBuddy *b)
484 const char **nw, const char **ne)
485 { 484 {
486 MsnUser *user; 485 MsnUser *user;
487 GaimPresence *presence;
488 const char *emblems[4] = { NULL, NULL, NULL, NULL };
489 int i = 0;
490
491 user = b->proto_data; 486 user = b->proto_data;
492 presence = gaim_buddy_get_presence(b); 487 if (user && user->mobile)
493 488 return "mobile";
494 if (!gaim_presence_is_online(presence)) 489 return NULL;
495 emblems[i++] = "offline";
496 else if (gaim_presence_is_status_active(presence, "busy") ||
497 gaim_presence_is_status_active(presence, "phone"))
498 emblems[i++] = "occupied";
499 else if (!gaim_presence_is_available(presence))
500 emblems[i++] = "away";
501
502 if (user == NULL)
503 {
504 emblems[0] = "offline";
505 }
506 else
507 {
508 if (user->mobile)
509 emblems[i++] = "wireless";
510 }
511
512 *se = emblems[0];
513 *sw = emblems[1];
514 *nw = emblems[2];
515 *ne = emblems[3];
516 } 490 }
517 491
518 static char * 492 static char *
519 msn_status_text(GaimBuddy *buddy) 493 msn_status_text(GaimBuddy *buddy)
520 { 494 {
1954 OPT_PROTO_MAIL_CHECK, 1928 OPT_PROTO_MAIL_CHECK,
1955 NULL, /* user_splits */ 1929 NULL, /* user_splits */
1956 NULL, /* protocol_options */ 1930 NULL, /* protocol_options */
1957 {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */ 1931 {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */
1958 msn_list_icon, /* list_icon */ 1932 msn_list_icon, /* list_icon */
1959 msn_list_emblems, /* list_emblems */ 1933 msn_list_emblem, /* list_emblems */
1960 msn_status_text, /* status_text */ 1934 msn_status_text, /* status_text */
1961 msn_tooltip_text, /* tooltip_text */ 1935 msn_tooltip_text, /* tooltip_text */
1962 msn_status_types, /* away_states */ 1936 msn_status_types, /* away_states */
1963 msn_blist_node_menu, /* blist_node_menu */ 1937 msn_blist_node_menu, /* blist_node_menu */
1964 NULL, /* chat_info */ 1938 NULL, /* chat_info */