cpw.gillux.detachablepurple: 7f873e7b: Removed the PurpleAccount's SetStatusLis...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Tue May 29 12:11:23 EDT 2012


----------------------------------------------------------------------
Revision: 7f873e7b7e7e971e207960fd09ab7e3cc1af9e9c
Parent:   e110726a862a4acfe739c705230863d481a9856e
Author:   gillux at soc.pidgin.im
Date:     05/29/12 09:57:22
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/7f873e7b7e7e971e207960fd09ab7e3cc1af9e9c

Changelog: 

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

Changes against parent e110726a862a4acfe739c705230863d481a9856e

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

-------------- next part --------------
============================================================
--- libpurple/account.c	a57ad6c857eee8bb67e5b59ba5939e04c621c7a1
+++ libpurple/account.c	59ba53345ad0c4b6f8788217a2e15b4e7b84b537
@@ -1655,10 +1655,6 @@ purple_account_set_status_list(PurpleAcc
 	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)
 	{
============================================================
--- libpurple/dbus/account.c	dcf932ca61be7a5916531b52b0fba93d1e3ba2b9
+++ libpurple/dbus/account.c	270a635d0386f8f3b3e293afb282f166f872615a
@@ -161,10 +161,6 @@ purple_account_class_dbus_init(PurpleAcc
 		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 @@ account_unregister_cb(PurpleAccount *acc
 	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;
-}
============================================================
--- libpurple/dbus/account.h	b479d46073f4c7dd2e6db16a66a635981d2d6081
+++ libpurple/dbus/account.h	2b84444535dbbee564c6ef788d7300bf7ef94da1
@@ -46,11 +46,6 @@ void purple_account_register_RPC(PurpleA
 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 @@ G_END_DECLS
 #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 */
============================================================
--- libpurple/dbus/account.xml	efa2d1002d08caee546b98c262a84ffa73daf991
+++ libpurple/dbus/account.xml	dd85b0f8b1921222647d0eba5f20b53a992e303a
@@ -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