Mercurial > pidgin
changeset 24285:a4a7084ee09d
Show when offline (because the plugin doesn't work no more).
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 21 Oct 2008 16:26:31 +0000 |
parents | 21caa58da895 |
children | 5f2496830fd4 |
files | finch/gntblist.c |
diffstat | 1 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/gntblist.c Tue Oct 21 16:16:40 2008 +0000 +++ b/finch/gntblist.c Tue Oct 21 16:26:31 2008 +0000 @@ -1288,6 +1288,17 @@ } static void +toggle_show_offline(GntMenuItem *item, gpointer buddy) +{ + purple_blist_node_set_bool(buddy, "show_offline", + !purple_blist_node_get_bool(buddy, "show_offline")); + if (!ggblist->manager->can_add_node(buddy)) + node_remove(purple_get_blist(), buddy); + else + node_update(purple_get_blist(), buddy); +} + +static void create_buddy_menu(GntMenu *menu, PurpleBuddy *buddy) { PurpleAccount *account; @@ -1322,10 +1333,10 @@ gnt_menuitem_set_callback(item, toggle_block_buddy, buddy); gnt_menu_add_item(menu, item); -#if 0 - add_custom_action(tree, _("View Log"), - PURPLE_CALLBACK(finch_blist_view_log_cb)), buddy); -#endif + item = gnt_menuitem_check_new(_("Show when offline")); + gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline")); + gnt_menuitem_set_callback(item, toggle_show_offline, buddy); + gnt_menu_add_item(menu, item); /* Protocol actions */ append_proto_menu(menu,