soc.2010.detachablepurple: 086707bc: Adapted purple_set_password RPC code to ...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Wed Jul 7 01:41:28 EDT 2010


----------------------------------------------------------------------
Revision: 086707bc9ebd6a9c565a51174c85c7f7b43a7130
Parent:   cc85c8630fb11a6ef6a68a6ae653c5647af1ae1e
Author:   gillux at soc.pidgin.im
Date:     07/06/10 23:36:27
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/086707bc9ebd6a9c565a51174c85c7f7b43a7130

Changelog: 

Adapted purple_set_password RPC code to make it use the
org.freedesktop.DBus.Properties.Set method.

Changes against parent cc85c8630fb11a6ef6a68a6ae653c5647af1ae1e

  patched  libpurple/account.c

-------------- next part --------------
============================================================
--- libpurple/account.c	e29d108344e99dec8fab101d3c6ed084075a4029
+++ libpurple/account.c	e10213966f5607f8def98edc878d7fb05b3b5a87
@@ -847,11 +847,17 @@ purple_account_new(const char *username,
 		}
 
 		/* Then, locally create a dummy account that will hold a proxy */
+		account = g_object_new(PURPLE_TYPE_ACCOUNT, NULL);
+		/* One for the im.pidgin.purple.account interface */
 		dbus_proxy = dbus_g_proxy_new_for_name(purple_dbus_get_g_connection(),
 											DBUS_PURPLE_SERVICE, dbus_path,
 											DBUS_ACCOUNT_INTERFACE);
-		account = g_object_new(PURPLE_TYPE_ACCOUNT, NULL);
-		purple_object_set_dbus_proxy(PURPLE_OBJECT(account), dbus_proxy);
+		purple_object_set_dbus_obj_proxy(PURPLE_OBJECT(account), dbus_proxy);
+		/* One for the org.freedesktop.DBus.Properties interface */
+		dbus_proxy = dbus_g_proxy_new_for_name(purple_dbus_get_g_connection(),
+											DBUS_PURPLE_SERVICE, dbus_path,
+											DBUS_INTERFACE_PROPERTIES);
+		purple_object_set_dbus_props_proxy(PURPLE_OBJECT(account), dbus_proxy);
 		return account;
 	}
 #endif
@@ -1429,13 +1435,23 @@ purple_account_set_password(PurpleAccoun
 #ifdef HAVE_DBUS
 	DBusGProxy *proxy;
 	GError *error = NULL;
+	GValue prop = {0, };
 
 	if (purple_core_get_remote_mode()) {
-		proxy = purple_object_get_dbus_proxy(PURPLE_OBJECT(account));
-		if (!im_pidgin_purple_account_set_password(proxy,
-												password, &error)) {
+		g_value_init(&prop, G_TYPE_STRING);
+		g_value_set_string(&prop, password);
+		proxy = purple_object_get_dbus_props_proxy(PURPLE_OBJECT(account));
+		if (!dbus_g_proxy_call(proxy, "Set", &error,
+							/* input parameters */
+							G_TYPE_STRING, DBUS_ACCOUNT_INTERFACE,
+							G_TYPE_STRING, "password",
+							G_TYPE_VALUE, &prop,
+							G_TYPE_INVALID,
+							/* output parameters */
+							G_TYPE_INVALID)) {
 			PURPLE_RPC_FAILED(purple_account_set_password, error);
 		}
+		g_value_unset(&prop);
 		return;
 	}
 #endif


More information about the Commits mailing list