/srv/mercurial-server/detachablepurple: bf13050284ed: Removed th...

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


Changeset: bf13050284ed873cdbcfbdaca12ac6aa100b96fa
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2012-05-29 13:57 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/bf13050284ed

Description:

Removed the PurpleAccount's SetStatusList D-Bus method.
This one would be better implemented in the status subsystem.

diffstat:

 libpurple/account.c        |   4 -
 libpurple/dbus/account.c   |  93 ----------------------------------------------
 libpurple/dbus/account.h   |   6 --
 libpurple/dbus/account.xml |   5 --
 4 files changed, 0 insertions(+), 108 deletions(-)

diffs (159 lines):

diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1655,10 +1655,6 @@
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 	g_return_if_fail(status_id != NULL);
 
-	/* Handle remote mode case */
-	if (purple_core_is_remote_mode())
-		return purple_account_set_status_list_RPC(account, status_id, active, attrs);
-
 	status = purple_account_get_status(account, status_id);
 	if (status == NULL)
 	{
diff --git a/libpurple/dbus/account.c b/libpurple/dbus/account.c
--- a/libpurple/dbus/account.c
+++ b/libpurple/dbus/account.c
@@ -161,10 +161,6 @@
 		purple_object_bind_dbus_callback
 		  (pobjclass, purple_account_interface_info.name,
 		   "Unregister",(GCallback)account_unregister_cb);
-/* Those are more complicated, we will handle them later.
-		purple_object_bind_dbus_method(pobjclass, "SetStatusList",
-		                               (GCallback)purple_account_set_status_list);
-*/
 	}
 	else if (purple_core_is_remote_mode()) {
 		purple_object_bind_dbus_callback
@@ -243,92 +239,3 @@
 	purple_account_unregister(account, cb, id);
 	return g_variant_new("(t)", ret);
 }
-
-void
-purple_account_set_status_list_RPC(PurpleAccount *account, const char *status_id, gboolean active, GList *attrs)
-{
-	DBusGProxy* proxy;
-	GError *error = NULL;
-	GPtrArray *attrs_array;
-	GValue *attr;
-	GValue *attr_new;
-	gchar* id;
-	GValue *id_val;
-	PurpleStatus *status;
-
-	/* Get the cached status_id of this account */
-	status = purple_account_get_status(account, status_id);
-	g_return_if_fail(status != NULL);
-
-	/* The attrs format is a an alternating string,pointer GList.
-	 * The type of the pointer depends on the string.
-	 * We convert this to a GPtrArray of GValues.
-	 */
-	attrs_array = g_ptr_array_new();
-	while (attrs) {
-		/* Get a copy of the attribute id */
-		id_val = g_new0(GValue, 1);
-		g_value_init(id_val, G_TYPE_STRING);
-		id = attrs->data;
-		g_value_set_string(id_val, id);
-
-		/* Get a copy of the attribute value */
-		attrs = attrs->next;
-		attr = purple_status_get_attr_value(status, attrs->data);
-		if (!attr) {
-			attrs = attrs->next;
-			continue;
-		}
-		attr_new = g_new0(GValue, 1);
-		g_value_copy(attr, attr_new);
-
-		/* Append the attribute id and value */
-		g_ptr_array_add(attrs_array, id_val);
-		g_ptr_array_add(attrs_array, attr_new);
-
-		attrs = attrs->next;
-	}
-
-	/* Execute the remote call */
-	proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
-	if (!im_pidgin_purple_account_set_status_list(proxy, status_id, active, attrs_array, &error))
-		PURPLE_RPC_FAILED(purple_account_register, error);
-
-	g_ptr_array_foreach(attrs_array, (GFunc)g_free, NULL);
-	g_ptr_array_free(attrs_array, TRUE);
-}
-
-gboolean
-DBUS_purple_account_set_status_list(PurpleAccount *account, char *status_id, gboolean active, GPtrArray *attrs, GError **error)
-{
-	GList *attrs_list = NULL;
-	GValue *val;
-	gpointer pval;
-	int i;
-
-	/* Convert the GPtrArray into an alternating string,pointer GList */
-	for (i = 0; i < attrs->len; i++) {
-		if (i%2) {
-			attrs_list = g_list_append(attrs_list, attrs->pdata[i]);
-		} else {
-			val = attrs->pdata[i];
-			switch (G_VALUE_TYPE(val)) {
-			case G_TYPE_STRING:
-				pval = g_strdup(g_value_get_string(val));
-				break;
-			case G_TYPE_INT:
-				pval = (gpointer)g_value_get_int(val);
-				break;
-			case G_TYPE_BOOLEAN:
-				pval = (gpointer)g_value_get_boolean(val);
-				break;
-			default:
-				pval = NULL;
-			}
-			attrs_list = g_list_append(attrs_list, pval);
-		}
-	}
-
-	purple_account_set_status_list(account, status_id, active, attrs_list);
-	return TRUE;
-}
diff --git a/libpurple/dbus/account.h b/libpurple/dbus/account.h
--- a/libpurple/dbus/account.h
+++ b/libpurple/dbus/account.h
@@ -46,11 +46,6 @@
 void purple_account_register_RPC(PurpleAccount* account);
 
 /**
- * Client side purple_account_set_status_list() wrapper.
- */
-void purple_account_set_status_list_RPC(PurpleAccount *account, const char *status_id, gboolean active, GList *attrs);
-
-/**
  * Client side purple_account_unregister() wrapper.
  */
 void purple_account_unregister_RPC(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
@@ -63,7 +58,6 @@
 #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)
 
 #endif /* HAVE_DBUS */
diff --git a/libpurple/dbus/account.xml b/libpurple/dbus/account.xml
--- a/libpurple/dbus/account.xml
+++ b/libpurple/dbus/account.xml
@@ -18,11 +18,6 @@
 			<arg type="b"  name="have_callback" direction="in" />
 			<arg type="t"  name="callback_id" direction="out" />
 		</method>
-		<method name="SetStatusList">
-			<arg type="s"  name="status_id"  direction="in" />
-			<arg type="b"  name="active"     direction="in" />
-			<arg type="av" name="attributes" direction="in" />
-		</method>
 
 		<signal name="NotifyAdded">
 			<arg type="s" name="remote_user" />



More information about the Commits mailing list