/pidgin/main: 0f6df320414b: Remove duplicate account-authorizati...

Elliott Sales de Andrade qulogic at pidgin.im
Sun Jan 27 05:57:48 EST 2013


Changeset: 0f6df320414ba3cd6ad090cd74b35ad1ae7e2928
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2013-01-26 00:31 -0500
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/0f6df320414b

Description:

Remove duplicate account-authorization-requested-with-message signal.

diffstat:

 ChangeLog.API                    |   2 ++
 doc/account-signals.dox          |  16 +---------------
 libpurple/account.c              |  24 ++----------------------
 libpurple/plugins/signals-test.c |   8 ++++----
 4 files changed, 9 insertions(+), 41 deletions(-)

diffs (127 lines):

diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -78,6 +78,7 @@ version 3.0.0 (??/??/????):
 		* PidginDockletFlag
 
 		Changed:
+		* account-authorization-requested signal merged with account-authorization-requested-with-message signal
 		* purple_account_add_buddy now takes an invite message as the last
 		  parameter
 		* purple_account_add_buddies now takes an invite message as the last
@@ -148,6 +149,7 @@ version 3.0.0 (??/??/????):
 		* _PurplePrivacyType
 		* _PurpleSoundEventID
 		* _XMLNodeType
+		* account-authorization-requested-with-message signal
 		* GtkIMHtml.clipboard_html_string
 		* GtkIMHtml.clipboard_text_string
 		* GtkIMHtmlFontDetail
diff --git a/doc/account-signals.dox b/doc/account-signals.dox
--- a/doc/account-signals.dox
+++ b/doc/account-signals.dox
@@ -14,7 +14,6 @@
   @signal account-actions-changed
   @signal account-alias-changed
   @signal account-authorization-requested
-  @signal account-authorization-requested-with-message
   @signal account-authorization-denied
   @signal account-authorization-granted
   @signal account-error-changed
@@ -145,19 +144,6 @@ void (*account_alias_changed)(PurpleAcco
 
  @signaldef account-authorization-requested
   @signalproto
-int (*account_authorization_requested)(PurpleAccount *account, const char *user);
-  @endsignalproto
-  @signaldesc
-   Emitted when a user requests authorization.
-  @param account The account.
-  @param user    The name of the user requesting authorization.
-  @return Less than zero to deny the request without prompting, greater
-          than zero if the request should be granted. If zero is returned,
-          then the user will be prompted with the request.
- @endsignaldef
-
- @signaldef account-authorization-requested-with-message
-  @signalproto
 int (*account_authorization_requested)(PurpleAccount *account, const char *user, const char *message);
   @endsignalproto
   @signaldesc
@@ -167,7 +153,7 @@ int (*account_authorization_requested)(P
   @param message The authorization request message
   @return PURPLE_ACCOUNT_RESPONSE_IGNORE to silently ignore the request,
           PURPLE_ACCOUNT_RESPONSE_DENY to block the request (the sender might
-          get informed, PURPLE_ACCOUNT_RESPONSE_ACCEPT if the request should be
+          get informed), PURPLE_ACCOUNT_RESPONSE_ACCEPT if the request should be
           granted. If PURPLE_ACCOUNT_RESPONSE_PASS is returned, then the user
           will be prompted with the request.
  @endsignaldef
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1424,23 +1424,9 @@ purple_account_request_authorization(Pur
 	ui_ops = purple_accounts_get_ui_ops();
 
 	plugin_return = GPOINTER_TO_INT(
-			purple_signal_emit_return_1(purple_accounts_get_handle(),
-				"account-authorization-requested", account, remote_user));
-
-	if (plugin_return > 0) {
-		if (auth_cb != NULL)
-			auth_cb(user_data);
-		return NULL;
-	} else if (plugin_return < 0) {
-		if (deny_cb != NULL)
-			deny_cb(user_data);
-		return NULL;
-	}
-
-	plugin_return = GPOINTER_TO_INT(
 			purple_signal_emit_return_1(
 				purple_accounts_get_handle(),
-				"account-authorization-requested-with-message",
+				"account-authorization-requested",
 				account, remote_user, message
 			));
 
@@ -3088,19 +3074,13 @@ purple_accounts_init(void)
 						 purple_value_new(PURPLE_TYPE_STRING));
 
 	purple_signal_register(handle, "account-authorization-requested",
-						purple_marshal_INT__POINTER_POINTER,
-						purple_value_new(PURPLE_TYPE_INT), 2,
-						purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						purple_value_new(PURPLE_TYPE_STRING));
-
-	purple_signal_register(handle, "account-authorization-requested-with-message",
 						purple_marshal_INT__POINTER_POINTER_POINTER,
 						purple_value_new(PURPLE_TYPE_INT), 3,
 						purple_value_new(PURPLE_TYPE_SUBTYPE,
 										PURPLE_SUBTYPE_ACCOUNT),
 						purple_value_new(PURPLE_TYPE_STRING),
 						purple_value_new(PURPLE_TYPE_STRING));
+
 	purple_signal_register(handle, "account-authorization-denied",
 						purple_marshal_VOID__POINTER_POINTER, NULL, 2,
 						purple_value_new(PURPLE_TYPE_SUBTYPE,
diff --git a/libpurple/plugins/signals-test.c b/libpurple/plugins/signals-test.c
--- a/libpurple/plugins/signals-test.c
+++ b/libpurple/plugins/signals-test.c
@@ -78,11 +78,11 @@ account_alias_changed(PurpleAccount *acc
 }
 
 static int
-account_authorization_requested_cb(PurpleAccount *account, const char *user, gpointer data)
+account_authorization_requested_cb(PurpleAccount *account, const char *user, const char *message, gpointer data)
 {
-	purple_debug_misc("signals test", "account-authorization-requested (%s, %s)\n",
-			purple_account_get_username(account), user);
-	return 0;
+	purple_debug_misc("signals test", "account-authorization-requested (%s, %s, %s)\n",
+			purple_account_get_username(account), user, message);
+	return PURPLE_ACCOUNT_RESPONSE_PASS;
 }
 
 static void



More information about the Commits mailing list