/pidgin/main: 84837bf0a2c8: Add "account-status-changing" signal...

Florian Qu?ze florian at instantbird.org
Sun May 15 13:50:58 EDT 2016


Changeset: 84837bf0a2c82a647756f82c66a348256559356a
Author:	 Florian Qu?ze <florian at instantbird.org>
Date:	 2016-05-15 05:28 -0300
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/84837bf0a2c8

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:

 ChangeLog.API       |  5 +++++
 libpurple/account.c |  9 +++++++++
 libpurple/prpl.c    |  3 +++
 3 files changed, 17 insertions(+), 0 deletions(-)

diffs (46 lines):

diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -1,5 +1,10 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+version 2.11.0:
+	libpurple:
+		Added:
+		* account-status-changing signal (account signals)
+
 version 2.10.12:
 	* No changes
 
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -3207,6 +3207,15 @@ purple_accounts_init(void)
 						 purple_marshal_VOID__POINTER, NULL, 1,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_ACCOUNT));
 
+	purple_signal_register(handle, "account-status-changing",
+						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
+						 purple_value_new(PURPLE_TYPE_SUBTYPE,
+										PURPLE_SUBTYPE_ACCOUNT),
+						 purple_value_new(PURPLE_TYPE_SUBTYPE,
+										PURPLE_SUBTYPE_STATUS),
+						 purple_value_new(PURPLE_TYPE_SUBTYPE,
+										PURPLE_SUBTYPE_STATUS));
+
 	purple_signal_register(handle, "account-status-changed",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
diff --git a/libpurple/prpl.c b/libpurple/prpl.c
--- a/libpurple/prpl.c
+++ b/libpurple/prpl.c
@@ -382,6 +382,9 @@ purple_prpl_change_account_status(Purple
 	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_prpl_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