soc.2010.detachablepurple: 93fa9332: Wrapped purple_account_register() for db...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sat Jul 17 12:37:27 EDT 2010


----------------------------------------------------------------------
Revision: 93fa93324af2ea007fc27631b1c76994ed975b6a
Parent:   790409d38476baf6d2a53cf12290cc07c67d53be
Author:   gillux at soc.pidgin.im
Date:     07/17/10 11:59:24
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/93fa93324af2ea007fc27631b1c76994ed975b6a

Changelog: 

Wrapped purple_account_register() for dbus.

Changes against parent 790409d38476baf6d2a53cf12290cc07c67d53be

  patched  libpurple/account-dbus.c
  patched  libpurple/account-dbus.h
  patched  libpurple/account.c
  patched  libpurple/dbus-prototypes/account.xml

-------------- next part --------------
============================================================
--- libpurple/account.c	2869a2919b24f8814fe77c1dfd01203ab45ef41d
+++ libpurple/account.c	62c655775858ba8e88da28acbf902e724abad66b
@@ -882,6 +882,10 @@ purple_account_register(PurpleAccount *a
 {
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 
+	/* Handle remote mode case */
+	if (purple_core_is_remote_mode())
+		return purple_account_register_RPC(account);
+
 	purple_debug_info("account", "Registering account %s\n",
 					purple_account_get_username(account));
 
============================================================
--- libpurple/account-dbus.c	584f823bfebf5166afbe15dd275525a79dfeb22d
+++ libpurple/account-dbus.c	745ddc86e143928062895589c1929046bc185b06
@@ -61,3 +61,22 @@ DBUS_purple_account_connect(PurpleAccoun
 	purple_account_connect(account);
 	return TRUE;
 }
+
+
+void
+purple_account_register_RPC(PurpleAccount* account)
+{
+	DBusGProxy* proxy;
+	GError *error = NULL;
+
+	proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
+	if (!im_pidgin_purple_account_register(proxy, &error))
+		PURPLE_RPC_FAILED(purple_account_register, error);
+}
+
+gboolean
+DBUS_purple_account_register(PurpleAccount *account, GError** error)
+{
+	purple_account_register(account);
+	return TRUE;
+}
============================================================
--- libpurple/account-dbus.h	c6fa1bdbfe23cf1bae620bc3b25cf638dca97d08
+++ libpurple/account-dbus.h	15a6f34c2c44bf008af6e661dc2ab0df1e3e8d20
@@ -16,9 +16,20 @@ gboolean DBUS_purple_account_connect(Pur
  */
 gboolean DBUS_purple_account_connect(PurpleAccount *account, GError** error);
 
+/**
+ * Client side purple_account_register() wrapper.
+ */
+void purple_account_register_RPC(PurpleAccount* account);
+
+/**
+ * Server side purple_account_register() wrapper.
+ */
+gboolean DBUS_purple_account_register(PurpleAccount *account, GError** error);
+
 #else /* !HAVE_DBUS */
 
 #define purple_account_new_RPC(username, protocol_id) (NULL)
 #define purple_account_connect_RPC(account)           ((void)0)
+#define purple_account_register_RPC(account)          ((void)0)
 
 #endif /* HAVE_DBUS */
============================================================
--- libpurple/dbus-prototypes/account.xml	a096ee777496d0beb19a884c70ed83e62f39914b
+++ libpurple/dbus-prototypes/account.xml	99b3d524faea16d27b83713e510d198e1a5cf390
@@ -11,6 +11,7 @@
 		<property type="b" name="check-mail"      access="readwrite" />
 
 		<method name="Connect" />
+		<method name="Register" />
 
 		<signal name="DBusNotify">
 			<arg type="s" name="property-name" />


More information about the Commits mailing list