soc.2010.detachablepurple: 7656e6de: Wrapped purple_account_disconnect() for ...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Thu Jul 29 02:01:51 EDT 2010
----------------------------------------------------------------------
Revision: 7656e6ded1545e8d36087f6f8bc1da9fcf67fab9
Parent: cf5d7f1c946b110205472373537c16d20abd3491
Author: gillux at soc.pidgin.im
Date: 07/28/10 21:01:34
Branch: im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/7656e6ded1545e8d36087f6f8bc1da9fcf67fab9
Changelog:
Wrapped purple_account_disconnect() for dbus.
Changes against parent cf5d7f1c946b110205472373537c16d20abd3491
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 82d102699d44d3cfe53d505b6457914dcf718f1c
+++ libpurple/account.c 357fbcee971f56ccc955a3abbd91d09e9ff5a7d6
@@ -1005,6 +1005,10 @@ purple_account_disconnect(PurpleAccount
g_return_if_fail(PURPLE_IS_ACCOUNT(account));
g_return_if_fail(!purple_account_is_disconnected(account));
+ /* Handle remote mode case */
+ if (purple_core_is_remote_mode())
+ return purple_account_disconnect_RPC(account);
+
username = purple_account_get_username(account);
purple_debug_info("account", "Disconnecting account %s (%p)\n",
username ? username : "(null)", account);
============================================================
--- libpurple/account-dbus.c 0534fb83a25d7693101ed915d8a7fa6dd5bc1bfe
+++ libpurple/account-dbus.c f41c2d48c7eab774d490ff6e5108daa9c6dd1563
@@ -101,7 +101,24 @@ DBUS_purple_account_connect(PurpleAccoun
return TRUE;
}
+void
+purple_account_disconnect_RPC(PurpleAccount* account)
+{
+ DBusGProxy* proxy;
+ GError *error = NULL;
+ proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
+ if (!im_pidgin_purple_account_disconnect(proxy, &error))
+ PURPLE_RPC_FAILED(purple_account_disconnect, error);
+}
+
+gboolean
+DBUS_purple_account_disconnect(PurpleAccount *account, GError** error)
+{
+ purple_account_disconnect(account);
+ return TRUE;
+}
+
void
purple_account_register_RPC(PurpleAccount* account)
{
============================================================
--- libpurple/account-dbus.h d208aa60879efceed44adcad9ef0f7cdd5d5d4d2
+++ libpurple/account-dbus.h 265ed8573ae136979845334c65dc44a3c272f49b
@@ -27,6 +27,16 @@ gboolean DBUS_purple_account_connect(Pur
gboolean DBUS_purple_account_connect(PurpleAccount *account, GError** error);
/**
+ * Client side purple_account_disconnect() wrapper.
+ */
+void purple_account_disconnect_RPC(PurpleAccount* account);
+
+/**
+ * Server side purple_account_disconnect() wrapper.
+ */
+gboolean DBUS_purple_account_disconnect(PurpleAccount *account, GError** error);
+
+/**
* Client side purple_account_register() wrapper.
*/
void purple_account_register_RPC(PurpleAccount* account);
@@ -54,7 +64,7 @@ void purple_account_unregister_RPC(Purpl
/**
* Server side purple_account_unregister() wrapper.
*/
-gboolean DBUS_purple_account_unregister(PurpleAccount *account, guint64 *callback_id, GError** error);
+gboolean DBUS_purple_account_unregister(PurpleAccount *account, gboolean have_callback, guint64 *callback_id, GError** error);
#else /* !HAVE_DBUS */
@@ -62,6 +72,7 @@ gboolean DBUS_purple_account_unregister(
#define purple_account_dbus_init(acc, user, proto) ((void)0)
#define purple_account_new_RPC(username, protocol_id) (NULL)
#define purple_account_connect_RPC(account) ((void)0)
+#define purple_account_disconnect_RPC(account) ((void)0)
#define purple_account_register_RPC(account) ((void)0)
#define purple_account_set_status_list_RPC(acc, status, active, attr) ((void)0)
#define purple_account_unregister_RPC(account, cb, user_data) ((void)0)
============================================================
--- libpurple/dbus-prototypes/account.xml 7f439e141a20e07c3040c55d1ea012bbc441b9f3
+++ libpurple/dbus-prototypes/account.xml 824fc048d086d381fce9722e645c1f811da50b0b
@@ -11,6 +11,7 @@
<property type="b" name="check-mail" access="readwrite" />
<method name="Connect" />
+ <method name="Disconnect" />
<method name="Register" />
<method name="Unregister">
<arg type="b" name="have_callback" direction="in" />
More information about the Commits
mailing list