/pidgin/main: 6ff708c38c04: Add "account-status-changing" signal...

Florian Qu?ze florian at instantbird.org
Wed May 25 12:11:18 EDT 2016


Changeset: 6ff708c38c049bd8ba32d0151ae7b38e9bfc84ea
Author:	 Florian Qu?ze <florian at instantbird.org>
Date:	 2016-05-15 15:32 -0300
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/6ff708c38c04

Description:

Add "account-status-changing" signal from instantbird

It's like "account-status-changed", but emitted before the status change
instead of after.

Instantbird ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=954403

diffstat:

 libpurple/accounts.c  |  5 +++++
 libpurple/protocols.c |  3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (28 lines):

diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -929,6 +929,11 @@ purple_accounts_init(void)
 						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
 						 PURPLE_TYPE_ACCOUNT);
 
+	purple_signal_register(handle, "account-status-changing",
+						 purple_marshal_VOID__POINTER_POINTER_POINTER,
+						 G_TYPE_NONE, 3, PURPLE_TYPE_ACCOUNT,
+						 PURPLE_TYPE_STATUS, PURPLE_TYPE_STATUS);
+
 	purple_signal_register(handle, "account-status-changed",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER,
 						 G_TYPE_NONE, 3, PURPLE_TYPE_ACCOUNT,
diff --git a/libpurple/protocols.c b/libpurple/protocols.c
--- a/libpurple/protocols.c
+++ b/libpurple/protocols.c
@@ -454,6 +454,9 @@ purple_protocol_change_account_status(Pu
 	g_return_if_fail(new_status != NULL);
 	g_return_if_fail(!purple_status_is_exclusive(new_status) || old_status != NULL);
 
+	purple_signal_emit(purple_accounts_get_handle(), "account-status-changing",
+					account, old_status, new_status);
+
 	do_protocol_change_account_status(account, old_status, new_status);
 
 	purple_signal_emit(purple_accounts_get_handle(), "account-status-changed",



More information about the Commits mailing list