changeset 12304:ae190d00b06d

[gaim-migrate @ 14608] This ensures the "account-status-changed" signal is always emitted, which makes the per-account status selectors show the correct status more accurately. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 03 Dec 2005 18:07:39 +0000
parents 01f689cd7b49
children 1504d878be54
files src/prpl.c
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/prpl.c	Sat Dec 03 18:00:01 2005 +0000
+++ b/src/prpl.c	Sat Dec 03 18:07:39 2005 +0000
@@ -275,17 +275,13 @@
 	g_slist_free(list);
 }
 
-void
-gaim_prpl_change_account_status(GaimAccount *account,
+static void
+do_prpl_change_account_status(GaimAccount *account,
 								GaimStatus *old_status, GaimStatus *new_status)
 {
 	GaimPlugin *prpl;
 	GaimPluginProtocolInfo *prpl_info;
 
-	g_return_if_fail(account    != NULL);
-	g_return_if_fail(old_status != NULL);
-	g_return_if_fail(new_status != NULL);
-
 	if (gaim_status_is_online(new_status) &&
 		gaim_account_is_disconnected(account))
 	{
@@ -318,11 +314,23 @@
 	if (prpl_info->set_status != NULL)
 	{
 		prpl_info->set_status(account, new_status);
-		gaim_signal_emit(gaim_accounts_get_handle(), "account-status-changed",
-						account, old_status, new_status);
 	}
 }
 
+void
+gaim_prpl_change_account_status(GaimAccount *account,
+								GaimStatus *old_status, GaimStatus *new_status)
+{
+	g_return_if_fail(account    != NULL);
+	g_return_if_fail(old_status != NULL);
+	g_return_if_fail(new_status != NULL);
+
+	do_prpl_change_account_status(account, old_status, new_status);
+
+	gaim_signal_emit(gaim_accounts_get_handle(), "account-status-changed",
+					account, old_status, new_status);
+}
+
 GList *
 gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence)
 {