pidgin: dd60852f: Show when offline (because the plugin do...

sadrul at pidgin.im sadrul at pidgin.im
Tue Oct 21 12:57:59 EDT 2008


-----------------------------------------------------------------
Revision: dd60852f53280649ffc76f6aca014bfb76e10426
Ancestor: b0b99c2ba66c763b9d7ce0fe7a85bda8c2e56834
Author: sadrul at pidgin.im
Date: 2008-10-21T16:26:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dd60852f53280649ffc76f6aca014bfb76e10426

Modified files:
        finch/gntblist.c

ChangeLog: 

Show when offline (because the plugin doesn't work no more).

-------------- next part --------------
============================================================
--- finch/gntblist.c	f8c33f33cc629c0355a7fde8f3f693b46586e043
+++ finch/gntblist.c	baec9ac0b96ecbd26b5018481cc6cb5d2792acb8
@@ -1288,6 +1288,17 @@ static void
 }
 
 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 @@ create_buddy_menu(GntMenu *menu, PurpleB
 	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,


More information about the Commits mailing list