im.pidgin.cpw.resiak.disconnectreason: d714bc96cce032a651cf5885941018cb5bcdb4e9

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sat Nov 3 07:13:19 EDT 2007


-----------------------------------------------------------------
Revision: d714bc96cce032a651cf5885941018cb5bcdb4e9
Ancestor: 4452f90540df5f77e671e6f693f01e13f36bb476
Author: resiak at soc.pidgin.im
Date: 2007-11-03T11:05:52
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Restore error notifications on the buddy list after a restart.  Make the Ignore
button on the signed in elsewhere notification clear the accounts' current
errors so that they aren't around to be restored after restarts.

References #168

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	5193fdd61a40c4eb5d2b955ef3e2df48fa2038ab
+++ pidgin/gtkblist.c	b4501fd296b9424e54eb67e9c91a875d34d3ed33
@@ -4498,7 +4498,13 @@ ignore_elsewhere_accounts(PidginBuddyLis
 ignore_elsewhere_accounts(PidginBuddyList *gtkblist)
 {
 	PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
+	GList *l;
 
+	for (l = priv->accounts_signed_on_elsewhere; l != NULL; l = l->next) {
+		PurpleAccount *account = l->data;
+		purple_account_clear_current_error(account);
+	}
+
 	g_list_free(priv->accounts_signed_on_elsewhere);
 	priv->accounts_signed_on_elsewhere = NULL;
 
@@ -4687,8 +4693,8 @@ remove_from_signed_on_elsewhere(PurpleAc
 	update_signed_on_elsewhere_minidialog_title();
 }
 
+
 /* Call appropriate error notification code based on error types */
-
 static void
 update_account_error_state(PurpleAccount *account,
                            const PurpleConnectionErrorInfo *old,
@@ -4716,6 +4722,26 @@ update_account_error_state(PurpleAccount
 	}
 }
 
+/* In case accounts are loaded before the blist (which they currently are),
+ * let's call update_account_error_state ourselves on every account's current
+ * state when the blist starts.
+ */
+static void
+show_initial_account_errors(PidginBuddyList *gtkblist)
+{
+	GList *l = purple_accounts_get_all();
+	PurpleAccount *account;
+	const PurpleConnectionErrorInfo *err;
+
+	for (; l; l = l->next)
+	{
+		account = l->data;
+		err = purple_account_get_current_error(account);
+
+		update_account_error_state(account, NULL, err, gtkblist);
+	}
+}
+
 void
 pidgin_blist_update_account_error_state(PurpleAccount *account, const char *text)
 {
@@ -5302,6 +5328,8 @@ static void pidgin_blist_show(PurpleBudd
 	gtk_widget_hide(gtkblist->headline_hbox);
 	gtk_widget_hide(gtkblist->error_buttons);
 
+	show_initial_account_errors(gtkblist);
+
 	/* emit our created signal */
 	handle = pidgin_blist_get_handle();
 	purple_signal_emit(handle, "gtkblist-created", list);


More information about the Commits mailing list