/srv/mercurial-server/detachablepurple: ef0617210da1: Rewritten ...

Gilles Bedel gillux at cpw.pidgin.im
Fri Jun 15 22:01:49 EDT 2012


Changeset: ef0617210da1afe9d60b0aadaa702b324b690628
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2012-05-25 19:03 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/ef0617210da1

Description:

Rewritten the "RequestAuthorize" D-Bus signal of PurpleAccount,
according to the new gdbus-based API.

diffstat:

 libpurple/dbus/account.c |  22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diffs (50 lines):

diff --git a/libpurple/dbus/account.c b/libpurple/dbus/account.c
--- a/libpurple/dbus/account.c
+++ b/libpurple/dbus/account.c
@@ -107,16 +107,12 @@
  * Callback, called when we receive a dbus "RequestAuthorize" signal.
  */
 static void
-request_authorize_cb(DBusGProxy *proxy, const char *remote_user,
+request_authorize_cb(PurpleAccount* account, const char *remote_user,
                      const char *id,    const char *alias, const char *message,
-                     gboolean on_list,  guint request_id,  gpointer data)
+                     gboolean on_list,  guint request_id)
 {
 	GClosure *close_req;
 	void *h;
-	PurpleAccount* account = PURPLE_ACCOUNT(
-                purple_dbus_get_gobject_by_path(dbus_g_proxy_get_path(proxy)));
-
-        g_return_if_fail(account != NULL);
 
         /* This calls the local request_authorize account uiop, with our
          * own auth/deny callbacks defined above. */
@@ -226,12 +222,6 @@
 		             purple_smarshal_VOID__STRING_STRING_STRING_STRING,
 		             G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING,
 		             G_TYPE_STRING, G_TYPE_STRING);
-		g_signal_new("request_authorize",
-		 PURPLE_TYPE_ACCOUNT, G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-		 purple_smarshal_VOID__STRING_STRING_STRING_STRING_BOOLEAN_UINT,
-		 G_TYPE_NONE, 6,
-		 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-		 G_TYPE_BOOLEAN, G_TYPE_UINT);
 	}
 	/* In remote mode we need to register the marshallers
 	 * we will use to receive the signals sent by the daemon */
@@ -241,11 +231,9 @@
 			purple_smarshal_VOID__STRING_STRING_STRING_STRING,
 			G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING,
 			G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
-		/* Marshaller for the RequestAuthorize dbus signal */
-		dbus_g_object_register_marshaller(
-		 purple_smarshal_VOID__STRING_STRING_STRING_STRING_BOOLEAN_UINT,
-		 G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-		 G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_INVALID);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_account_interface_info.name,
+		   "RequestAuthorize", (GCallback)request_authorize_cb);
 	}
 }
 



More information about the Commits mailing list