Mercurial > pidgin
comparison src/protocols/msn/msn.c @ 9951:42cdec4f639b
[gaim-migrate @ 10847]
<faceprint> datallah: i can just commit that without thinking, right?
<audiokat2> faceprint: you can't break HEAD any worse right now :)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 04 Sep 2004 16:51:49 +0000 |
parents | f8e395a054e2 |
children | d908907d9441 |
comparison
equal
deleted
inserted
replaced
9950:ba085944efee | 9951:42cdec4f639b |
---|---|
417 *nw = emblems[2]; | 417 *nw = emblems[2]; |
418 *ne = emblems[3]; | 418 *ne = emblems[3]; |
419 } | 419 } |
420 | 420 |
421 static char * | 421 static char * |
422 msn_status_text(GaimBuddy *b) | 422 msn_status_text(GaimBuddy *buddy) |
423 { | 423 { |
424 if (b->uc & UC_UNAVAILABLE) | 424 GaimPresence *presence = gaim_buddy_get_presence(buddy); |
425 return g_strdup(msn_away_get_text(MSN_AWAY_TYPE(b->uc))); | 425 GaimStatus *status = gaim_presence_get_active_status(presence); |
426 | |
427 if (!gaim_status_is_available(status)) | |
428 return g_strdup(gaim_status_get_name(status)); | |
426 | 429 |
427 return NULL; | 430 return NULL; |
428 } | 431 } |
429 | 432 |
430 static char * | 433 static char * |
431 msn_tooltip_text(GaimBuddy *b) | 434 msn_tooltip_text(GaimBuddy *buddy) |
432 { | 435 { |
436 GaimPresence *presence = gaim_buddy_get_presence(buddy); | |
437 GaimStatus *status = gaim_presence_get_active_status(presence); | |
433 char *text = NULL; | 438 char *text = NULL; |
434 | 439 |
435 if (GAIM_BUDDY_IS_ONLINE(b)) | 440 if (gaim_presence_is_online(presence)) |
436 { | 441 { |
437 text = g_strdup_printf(_("\n<b>%s:</b> %s"), _("Status"), | 442 text = g_strdup_printf(_("\n<b>%s:</b> %s"), _("Status"), |
438 msn_away_get_text(MSN_AWAY_TYPE(b->uc))); | 443 gaim_status_get_name(status)); |
439 } | 444 } |
440 | 445 |
441 return text; | 446 return text; |
442 } | 447 } |
443 | 448 |
444 static GList * | 449 static GList * |
445 msn_away_states(GaimConnection *gc) | 450 msn_status_types(GaimAccount *account) |
446 { | 451 { |
447 GList *m = NULL; | 452 GaimStatusType *offline; |
448 | 453 GaimStatusType *online; |
449 m = g_list_append(m, _("Available")); | 454 GaimStatusType *unavail; |
450 m = g_list_append(m, _("Away From Computer")); | 455 GList *types = NULL; |
451 m = g_list_append(m, _("Be Right Back")); | 456 |
452 m = g_list_append(m, _("Busy")); | 457 offline = gaim_status_type_new(GAIM_STATUS_OFFLINE, |
453 m = g_list_append(m, _("On The Phone")); | 458 "offline", _("Offline"), FALSE); |
454 m = g_list_append(m, _("Out To Lunch")); | 459 types = g_list_append(types, offline); |
455 m = g_list_append(m, _("Hidden")); | 460 |
456 | 461 online = gaim_status_type_new(GAIM_STATUS_ONLINE, |
457 return m; | 462 "online", _("Online"), FALSE); |
463 types = g_list_append(types, online); | |
464 | |
465 gaim_status_type_new(online, GAIM_STATUS_AVAILABLE, "available", | |
466 _("Available"), FALSE, FALSE, FALSE); | |
467 unavail = gaim_status_type_new(online, GAIM_STATUS_UNAVAILABLE, | |
468 "unavailable", _("Unavailable"), | |
469 FALSE, FALSE, FALSE); | |
470 | |
471 gaim_status_type_new(unavail, GAIM_STATUS_AWAY, "away", | |
472 _("Away"), FALSE, TRUE, FALSE); | |
473 gaim_status_type_new(unavail, GAIM_STATUS_AWAY, "brb", | |
474 _("Be Right Back"), FALSE, TRUE, FALSE); | |
475 gaim_status_type_new(unavail, GAIM_STATUS_AWAY, "busy", | |
476 _("Busy"), FALSE, TRUE, FALSE); | |
477 gaim_status_type_new(unavail, GAIM_STATUS_AWAY, "phone", | |
478 _("On The Phone"), FALSE, TRUE, FALSE); | |
479 gaim_status_type_new(unavail, GAIM_STATUS_AWAY, "lunch", | |
480 _("Out To Lunch"), FALSE, TRUE, FALSE); | |
481 gaim_status_type_new(unavail, GAIM_STATUS_HIDDEN, "hidden", | |
482 _("Hidden"), FALSE, TRUE, FALSE); | |
483 | |
484 return types; | |
458 } | 485 } |
459 | 486 |
460 static GList * | 487 static GList * |
461 msn_actions(GaimPlugin *plugin, gpointer context) | 488 msn_actions(GaimPlugin *plugin, gpointer context) |
462 { | 489 { |
1646 {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ | 1673 {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ |
1647 msn_list_icon, /* list_icon */ | 1674 msn_list_icon, /* list_icon */ |
1648 msn_list_emblems, /* list_emblems */ | 1675 msn_list_emblems, /* list_emblems */ |
1649 msn_status_text, /* status_text */ | 1676 msn_status_text, /* status_text */ |
1650 msn_tooltip_text, /* tooltip_text */ | 1677 msn_tooltip_text, /* tooltip_text */ |
1651 msn_away_states, /* away_states */ | 1678 msn_status_types, /* away_states */ |
1652 msn_blist_node_menu, /* blist_node_menu */ | 1679 msn_blist_node_menu, /* blist_node_menu */ |
1653 NULL, /* chat_info */ | 1680 NULL, /* chat_info */ |
1654 NULL, /* chat_info_defaults */ | 1681 NULL, /* chat_info_defaults */ |
1655 msn_login, /* login */ | 1682 msn_login, /* login */ |
1656 msn_close, /* close */ | 1683 msn_close, /* close */ |
1657 msn_send_im, /* send_im */ | 1684 msn_send_im, /* send_im */ |
1658 NULL, /* set_info */ | 1685 NULL, /* set_info */ |
1659 msn_send_typing, /* send_typing */ | 1686 msn_send_typing, /* send_typing */ |
1660 msn_get_info, /* get_info */ | 1687 msn_get_info, /* get_info */ |
1661 msn_set_away, /* set_away */ | 1688 msn_set_away, /* set_away */ |
1667 NULL, /* remove_buddies */ | 1694 NULL, /* remove_buddies */ |
1668 msn_add_permit, /* add_permit */ | 1695 msn_add_permit, /* add_permit */ |
1669 msn_add_deny, /* add_deny */ | 1696 msn_add_deny, /* add_deny */ |
1670 msn_rem_permit, /* rem_permit */ | 1697 msn_rem_permit, /* rem_permit */ |
1671 msn_rem_deny, /* rem_deny */ | 1698 msn_rem_deny, /* rem_deny */ |
1672 msn_set_permit_deny, /* set_permit_deny */ | 1699 msn_set_permit_deny, /* set_permit_deny */ |
1673 NULL, /* warn */ | 1700 NULL, /* warn */ |
1674 NULL, /* join_chat */ | 1701 NULL, /* join_chat */ |
1675 NULL, /* reject chat invite */ | 1702 NULL, /* reject chat invite */ |
1676 NULL, /* get_chat_name */ | 1703 NULL, /* get_chat_name */ |
1677 msn_chat_invite, /* chat_invite */ | 1704 msn_chat_invite, /* chat_invite */ |