# HG changeset patch # User Will Thompson # Date 1194087952 0 # Node ID 04b1742c820626a7fc1dc21ced4c665fd9316d84 # Parent ff5cd00e4f144423c38273c1ed80fb8626c8db37 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 diff -r ff5cd00e4f14 -r 04b1742c8206 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sat Nov 03 00:25:33 2007 +0000 +++ b/pidgin/gtkblist.c Sat Nov 03 11:05:52 2007 +0000 @@ -4498,6 +4498,12 @@ 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 @@ 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 @@ } } +/* 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 @@ 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);