changeset 22676:a73acc0c4dc8

Ignore token_status_account on account-specific status boxes. This should fix a plugin-pack bug (#501).
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 22 Apr 2008 05:32:08 +0000
parents f35a57b8f4ce
children 04dc38d726fb
files pidgin/gtkstatusbox.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkstatusbox.c	Sun Apr 20 15:37:39 2008 +0000
+++ b/pidgin/gtkstatusbox.c	Tue Apr 22 05:32:08 2008 +0000
@@ -74,6 +74,7 @@
 static void remove_typing_cb(PidginStatusBox *box);
 static void update_size (PidginStatusBox *box);
 static gint get_statusbox_index(PidginStatusBox *box, PurpleSavedStatus *saved_status);
+static PurpleAccount* check_active_accounts_for_identical_statuses(void);
 
 static void pidgin_status_box_pulse_typing(PidginStatusBox *status_box);
 static void pidgin_status_box_refresh(PidginStatusBox *status_box);
@@ -497,6 +498,10 @@
 		break;
 	case PROP_ACCOUNT:
 		statusbox->account = g_value_get_pointer(value);
+		if (statusbox->account)
+			statusbox->token_status_account = NULL;
+		else
+			statusbox->token_status_account = check_active_accounts_for_identical_statuses();
 
 		pidgin_status_box_regenerate(statusbox);
 
@@ -628,7 +633,7 @@
 	GdkPixbuf *pixbuf, *emblem = NULL;
 	GtkTreePath *path;
 	gboolean account_status = FALSE;
-	PurpleAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account;
+	PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account;
 
 	icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
 
@@ -1228,9 +1233,13 @@
 								     icon_size, "PidginStatusBox");
 }
 
-static void account_enabled_cb(PurpleAccount *acct, PidginStatusBox *status_box) {
+static void account_enabled_cb(PurpleAccount *acct, PidginStatusBox *status_box)
+{
 	PurpleAccount *initial_token_acct = status_box->token_status_account;
 
+	if (status_box->account)
+		return;
+
 	status_box->token_status_account = check_active_accounts_for_identical_statuses();
 
 	/* Regenerate the list if it has changed */