cpw.gillux.detachablepurple: 0ee40108: Rewritten the "RequestAuthorize" D-Bus s...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Fri May 25 15:46:45 EDT 2012


----------------------------------------------------------------------
Revision: 0ee4010839ed5289ead6ede5e484f9ec54ca92a9
Parent:   8fdb17ac4d4551273dd61006908e89691fcba6f7
Author:   gillux at soc.pidgin.im
Date:     05/25/12 15:03:49
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/0ee4010839ed5289ead6ede5e484f9ec54ca92a9

Changelog: 

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

Changes against parent 8fdb17ac4d4551273dd61006908e89691fcba6f7

  patched  libpurple/dbus/account.c

-------------- next part --------------
============================================================
--- libpurple/dbus/account.c	b1f8bc5e75b9ed81de64575a6547590877a9ce95
+++ libpurple/dbus/account.c	6c3132a77592246d6a220f2eda38c70b3102eaf5
@@ -107,17 +107,13 @@ static void
  * 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. */
         h = purple_account_request_authorization(account, remote_user, id,
@@ -226,12 +222,6 @@ purple_account_class_dbus_init(PurpleAcc
 		             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_account_class_dbus_init(PurpleAcc
 			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