--- a/pidgin/gtkblist.c Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/gtkblist.c Fri May 27 03:05:57 2022 -0500
@@ -128,7 +128,6 @@
- PROTOCOL_ICON_VISIBLE_COLUMN,
@@ -231,20 +230,6 @@
-gtk_blist_hide_cb(GtkWidget *widget, PidginBuddyList *gtkblist)
- purple_signal_emit(pidgin_blist_get_handle(),
- "gtkblist-hiding", gtkblist);
-gtk_blist_show_cb(GtkWidget *widget, PidginBuddyList *gtkblist)
- purple_signal_emit(pidgin_blist_get_handle(),
- "gtkblist-unhiding", gtkblist);
static void gtk_blist_menu_info_cb(GtkWidget *w, PurpleBuddy *b)
PurpleAccount *account = purple_buddy_get_account(b);
@@ -661,49 +646,6 @@
gtk_tree_path_free(path);
-static void gtk_blist_menu_showoffline_cb(GtkWidget *w, PurpleBlistNode *node)
- if (PURPLE_IS_BUDDY(node))
- purple_blist_node_set_bool(node, "show_offline",
- !purple_blist_node_get_bool(node, "show_offline"));
- pidgin_blist_update(purple_blist_get_default(), node);
- else if (PURPLE_IS_CONTACT(node))
- PurpleBlistNode *bnode;
- gboolean setting = !purple_blist_node_get_bool(node, "show_offline");
- purple_blist_node_set_bool(node, "show_offline", setting);
- for (bnode = purple_blist_node_get_first_child(node);
- bnode = purple_blist_node_get_sibling_next(bnode))
- purple_blist_node_set_bool(bnode, "show_offline", setting);
- pidgin_blist_update(purple_blist_get_default(), bnode);
- } else if (PURPLE_IS_GROUP(node)) {
- PurpleBlistNode *cnode, *bnode;
- gboolean setting = !purple_blist_node_get_bool(node, "show_offline");
- purple_blist_node_set_bool(node, "show_offline", setting);
- for (cnode = purple_blist_node_get_first_child(node);
- cnode = purple_blist_node_get_sibling_next(cnode))
- purple_blist_node_set_bool(cnode, "show_offline", setting);
- for (bnode = purple_blist_node_get_first_child(cnode);
- bnode = purple_blist_node_get_sibling_next(bnode))
- purple_blist_node_set_bool(bnode, "show_offline", setting);
- pidgin_blist_update(purple_blist_get_default(),
do_join_chat(PidginChatData *data)
@@ -1456,13 +1398,6 @@
- if (!purple_blist_node_is_transient(node)) {
- gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
- pidgin_new_menu_item(menu,
- show_offline ? _("Hide When Offline") : _("Show When Offline"),
- NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node);
pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_buddy_get_account(buddy)), node);
pidgin_append_blist_node_extended_menu(menu, node);
@@ -1638,12 +1573,6 @@
G_CALLBACK(pidgin_blist_remove_cb), node);
pidgin_new_menu_item(menu, _("_Rename"), NULL,
G_CALLBACK(gtk_blist_menu_alias_cb), node);
- if (!purple_blist_node_is_transient(node)) {
- gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
- pidgin_new_menu_item(menu,
- show_offline ? _("Hide When Offline") : _("Show When Offline"),
- NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node);
add_buddy_icon_menu_items(menu, node);
@@ -1718,7 +1647,6 @@
PidginBlistNode *gtknode = g_object_get_data(G_OBJECT(node), UI_DATA);
- gboolean show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
pidgin_blist_make_buddy_menu(menu, b, FALSE);
@@ -1750,8 +1678,6 @@
if(!purple_account_get_connection(purple_buddy_get_account(buddy)))
- if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy))
menuitem = gtk_menu_item_new_with_label(purple_buddy_get_name(buddy));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
@@ -2082,18 +2008,10 @@
static gboolean buddy_is_displayable(PurpleBuddy *buddy)
- PidginBlistNode *gtknode;
- gtknode = g_object_get_data(G_OBJECT(buddy), UI_DATA);
- return (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
- (purple_presence_is_online(purple_buddy_get_presence(buddy)) ||
- (gtknode && gtknode->recent_signonoff) ||
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") ||
- purple_blist_node_get_bool(PURPLE_BLIST_NODE(buddy), "show_offline")));
+ return purple_account_is_connected(purple_buddy_get_account(buddy)); @@ -2699,9 +2617,7 @@
pidgin_node = g_object_get_data(G_OBJECT(node->parent), UI_DATA);
if(pidgin_node->contact_expanded) {
- if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"))
- return pidgin_create_protocol_icon(purple_buddy_get_account((PurpleBuddy*)node), PIDGIN_PROTOCOL_ICON_SMALL);
@@ -2889,12 +2805,7 @@
name = purple_buddy_get_alias(b);
- /* Raise a contact pre-draw signal here. THe callback will return an
- * escaped version of the name. */
- nametext = purple_signal_emit_return_1(pidgin_blist_get_handle(), "drawing-buddy", b);
- nametext = g_markup_escape_text(name, strlen(name));
+ nametext = g_markup_escape_text(name, strlen(name)); presence = purple_buddy_get_presence(b);
@@ -2927,7 +2838,7 @@
statustext = g_strdup(_("Offline"));
- if (purple_presence_is_idle(presence) && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")) {
+ if (purple_presence_is_idle(presence)) { time_t idle_secs = purple_presence_get_idle_time(presence);
@@ -3178,38 +3089,6 @@
pidgin_blist_sort_method_set(id);
-static void _prefs_change_redo_list(const char *name, PurplePrefType type,
- gconstpointer val, gpointer data)
- PurpleBlistNode *node = NULL;
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview));
- if (gtk_tree_selection_get_selected(sel, NULL, &iter))
- gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1);
- redo_buddy_list(purple_blist_get_default(), FALSE, FALSE);
- gtk_tree_view_columns_autosize(GTK_TREE_VIEW(gtkblist->treeview));
- PidginBlistNode *gtknode;
- gtknode = g_object_get_data(G_OBJECT(node), UI_DATA);
- if (gtknode && gtknode->row)
- path = gtk_tree_row_reference_get_path(gtknode->row);
- gtk_tree_selection_select_path(sel, path);
- gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0);
- gtk_tree_path_free(path);
static void _prefs_change_sort_method(const char *pref_name, PurplePrefType type,
gconstpointer val, gpointer data)
@@ -3809,7 +3688,6 @@
gtk_tree_view_column_pack_start(column, rend, FALSE);
gtk_tree_view_column_set_attributes(column, rend,
"pixbuf", PROTOCOL_ICON_COLUMN,
- "visible", PROTOCOL_ICON_VISIBLE_COLUMN,
g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
@@ -3896,10 +3774,6 @@
gtkblist->vbox = pidgin_contact_list_get_vbox(PIDGIN_CONTACT_LIST(gtkblist->window));
g_signal_connect(G_OBJECT(gtkblist->window), "delete_event", G_CALLBACK(gtk_blist_delete_cb), NULL);
- g_signal_connect(G_OBJECT(gtkblist->window), "hide",
- G_CALLBACK(gtk_blist_hide_cb), gtkblist);
- g_signal_connect(G_OBJECT(gtkblist->window), "show",
- G_CALLBACK(gtk_blist_show_cb), gtkblist);
g_signal_connect(G_OBJECT(gtkblist->window), "visibility_notify_event", G_CALLBACK(gtk_blist_visibility_cb), NULL);
g_signal_connect(G_OBJECT(gtkblist->window), "window_state_event", G_CALLBACK(gtk_blist_window_state_cb), NULL);
gtk_widget_add_events(gtkblist->window, GDK_VISIBILITY_NOTIFY_MASK);
@@ -3917,8 +3791,7 @@
G_TYPE_BOOLEAN, /* Contact expander visible */
GDK_TYPE_PIXBUF, /* Emblem */
G_TYPE_BOOLEAN, /* Emblem visible */
- GDK_TYPE_PIXBUF, /* Protocol icon */
- G_TYPE_BOOLEAN /* Protocol visible */
+ GDK_TYPE_PIXBUF /* Protocol icon */ gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel));
@@ -3993,16 +3866,6 @@
handle = pidgin_blist_get_handle();
- /* things that affect how buddies are displayed */
- purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time",
- _prefs_change_redo_list, NULL);
- purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
- _prefs_change_redo_list, NULL);
- purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
- _prefs_change_redo_list, NULL);
- purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
- _prefs_change_redo_list, NULL);
purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type",
_prefs_change_sort_method, NULL);
@@ -4213,34 +4076,14 @@
-static gboolean pidgin_blist_group_has_show_offline_buddy(PurpleGroup *group)
- PurpleBlistNode *gnode, *cnode, *bnode;
- gnode = PURPLE_BLIST_NODE(group);
- for(cnode = gnode->child; cnode; cnode = cnode->next) {
- if(PURPLE_IS_CONTACT(cnode)) {
- for(bnode = cnode->child; bnode; bnode = bnode->next) {
- PurpleBuddy *buddy = (PurpleBuddy *)bnode;
- if (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
- purple_blist_node_get_bool(bnode, "show_offline"))
/* This version of pidgin_blist_update_group can take the original buddy or a
* group, but has much better algorithmic performance with a pre-known buddy.
static void pidgin_blist_update_group(PurpleBuddyList *list,
- gboolean show = FALSE, show_offline = FALSE;
g_return_if_fail(node != NULL);
@@ -4256,22 +4099,7 @@
- group = (PurpleGroup*)gnode;
- show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
- count = purple_counting_node_get_current_size(PURPLE_COUNTING_NODE(group));
- count = purple_counting_node_get_online_count(PURPLE_COUNTING_NODE(group));
- if (count > 0 || purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups"))
- else if (PURPLE_IS_BUDDY(node) && buddy_is_displayable((PurpleBuddy*)node)) { /* Or chat? */
- } else if (!show_offline) {
- show = pidgin_blist_group_has_show_offline_buddy(group);
@@ -4378,7 +4206,6 @@
EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
PROTOCOL_ICON_COLUMN, protocol_icon,
- PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
CONTACT_EXPANDER_COLUMN, NULL,
CONTACT_EXPANDER_VISIBLE_COLUMN, pidgin_node->contact_expanded,
GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
@@ -4547,7 +4374,6 @@
EMBLEM_VISIBLE_COLUMN, emblem != NULL,
PROTOCOL_ICON_COLUMN, protocol_icon,
- PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
@@ -5108,27 +4934,19 @@
purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
+ purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_empty_groups"); + purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_idle_time"); + purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"); + purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"); purple_prefs_add_none(PIDGIN_PREFS_ROOT "/blist");
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", TRUE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", FALSE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", FALSE);
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE);
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE);
purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/sort_type", "alphabetical");
purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/theme", "");
/* Register our signals */
- purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
- purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
- PURPLE_TYPE_BUDDY_LIST);
- purple_signal_register(gtk_blist_handle, "gtkblist-unhiding",
- purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
- PURPLE_TYPE_BUDDY_LIST);
purple_signal_register(gtk_blist_handle, "gtkblist-created",
purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
@@ -5139,10 +4957,6 @@
G_TYPE_POINTER, /* pointer to a (GString *) */
- purple_signal_register(gtk_blist_handle, "drawing-buddy",
- purple_marshal_POINTER__POINTER,
- G_TYPE_STRING, 1, PURPLE_TYPE_BUDDY);
purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on",
gtk_blist_handle, G_CALLBACK(buddy_signonoff_cb), NULL);
purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off",
--- a/pidgin/pidginactiongroup.c Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/pidginactiongroup.c Fri May 27 03:05:57 2022 -0500
@@ -35,70 +35,6 @@
*****************************************************************************/
- * pidgin_action_group_bool_pref_handler:
- * @group: The #PidginActionGroup instance.
- * @action_name: The name of the action to update.
- * @value: The value of the preference.
- * Changes the state of the action named @action_name to match @value.
- * This function is meant to be called from a #PurplePrefCallback function as
- * there isn't a good way to have a #PurplePrefCallback with multiple items in
- * the data parameter without leaking them forever.
-pidgin_action_group_bool_pref_handler(PidginActionGroup *group,
- const gchar *action_name,
- GAction *action = NULL;
- action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name);
- g_simple_action_set_state(G_SIMPLE_ACTION(action),
- g_variant_new_boolean(value));
- * pidgin_action_group_setup_bool:
- * @group: The #PidginActionGroup instance.
- * @action_name: The name of the action to setup.
- * @pref_name: The name of the preference that @action_name is tied to.
- * @callback: (scope notified): A #PurplePrefCallback to call when the
- * preference is changed.
- * Initializes the boolean action named @action_name to the value of @pref_name
- * and setups up a preference change callback to @callback to maintain the
-pidgin_action_group_setup_bool(PidginActionGroup *group,
- const gchar *action_name,
- const gchar *pref_name,
- PurplePrefCallback callback)
- GAction *action = NULL;
- gboolean value = FALSE;
- /* find the action, if we can't find it, bail */
- action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name);
- g_return_if_fail(action != NULL);
- /* get the value of the preference */
- value = purple_prefs_get_bool(pref_name);
- /* change the state of the action to match the preference value. */
- g_simple_action_set_state(G_SIMPLE_ACTION(action),
- g_variant_new_boolean(value));
- /* finally add a preference callback to update the state based on the
- purple_prefs_connect_callback(group, pref_name, callback, group);
* pidgin_action_group_string_pref_handler:
* @group: The #PidginActionGroup instance.
* @action_name: The name of the action to update.
@@ -164,58 +100,6 @@
*****************************************************************************/
-pidgin_action_group_show_empty_groups_callback(const gchar *name,
- PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
- pidgin_action_group_bool_pref_handler(group,
- PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
- (gboolean)GPOINTER_TO_INT(value));
-pidgin_action_group_show_idle_times_callback(const gchar *name,
- PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
- pidgin_action_group_bool_pref_handler(group,
- PIDGIN_ACTION_SHOW_IDLE_TIMES,
- (gboolean)GPOINTER_TO_INT(value));
-pidgin_action_group_show_offline_buddies_callback(const gchar *name,
- PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
- pidgin_action_group_bool_pref_handler(group,
- PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
- (gboolean)GPOINTER_TO_INT(value));
-pidgin_action_group_show_protocol_icons_callback(const gchar *name,
- PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
- pidgin_action_group_bool_pref_handler(group,
- PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
- (gboolean)GPOINTER_TO_INT(value));
pidgin_action_group_sort_method_callback(const gchar *name,
@@ -232,41 +116,6 @@
*****************************************************************************/
-pidgin_action_group_show_empty_groups(GSimpleAction *action, GVariant *value,
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
- g_variant_get_boolean(value));
-pidgin_action_group_show_idle_times(GSimpleAction *action,
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time",
- g_variant_get_boolean(value));
-pidgin_action_group_show_offline_buddies(GSimpleAction *action,
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
- g_variant_get_boolean(value));
-pidgin_action_group_show_protocol_icons(GSimpleAction *action,
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
- g_variant_get_boolean(value));
pidgin_action_group_sort_method(GSimpleAction *action, GVariant *value,
@@ -284,22 +133,6 @@
pidgin_action_group_init(PidginActionGroup *group) {
GActionEntry entries[] = {
- .name = PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
- .change_state = pidgin_action_group_show_empty_groups,
- .name = PIDGIN_ACTION_SHOW_IDLE_TIMES,
- .change_state = pidgin_action_group_show_idle_times,
- .name = PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
- .change_state = pidgin_action_group_show_offline_buddies,
- .name = PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
- .change_state = pidgin_action_group_show_protocol_icons,
.name = PIDGIN_ACTION_SORT_METHOD,
@@ -313,19 +146,6 @@
/* now add some handlers for preference changes and set actions to the
- pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
- PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
- pidgin_action_group_show_empty_groups_callback);
- pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_IDLE_TIMES,
- PIDGIN_PREFS_ROOT "/blist/show_idle_time",
- pidgin_action_group_show_idle_times_callback);
- pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
- PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
- pidgin_action_group_show_offline_buddies_callback);
- pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
- PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
- pidgin_action_group_show_protocol_icons_callback);
pidgin_action_group_setup_string(group, PIDGIN_ACTION_SORT_METHOD,
PIDGIN_PREFS_ROOT "/blist/sort_type",
pidgin_action_group_sort_method_callback);