soc.2009.telepathy: 5132d2ae: Ask AccountManager to change statuses

sttwister at soc.pidgin.im sttwister at soc.pidgin.im
Tue Jul 28 11:05:24 EDT 2009


-----------------------------------------------------------------
Revision: 5132d2ae2861b5e6fbafff1cad281f3ce3c61ae0
Ancestor: 63537fd40400665bf59837acbf0ebc15d6bde305
Author: sttwister at soc.pidgin.im
Date: 2009-07-27T23:08:23
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/5132d2ae2861b5e6fbafff1cad281f3ce3c61ae0

Modified files:
        libpurple/protocols/telepathy/telepathy.c

ChangeLog: 

Ask AccountManager to change statuses

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy.c	e1553ecfd80c28d49f426c7cc5b88645cc4a5b7b
+++ libpurple/protocols/telepathy/telepathy.c	a6971e2a5b910748e84b9b98faf59e50270e3fdf
@@ -388,19 +388,26 @@ telepathy_set_status (PurpleAccount *acc
 static void
 telepathy_set_status (PurpleAccount *account, PurpleStatus *status)
 {
-	PurpleConnection *gc = purple_account_get_connection(account);
-	telepathy_connection *data = purple_connection_get_protocol_data(gc);
+	telepathy_account *account_data = (telepathy_account*)purple_account_get_int(
+			account, "tp_account_data", 0);
 
+	GValueArray *initial_presence;
+
 	const gchar *presence_id = purple_status_get_id(status);
 	const gchar *presence_message = purple_status_get_attr_string(status, "message");
 
 	purple_debug_info("telepathy", "Setting status %s (%s) for %s\n", 
 			presence_id, presence_message, purple_account_get_username(account));
 
-	tp_cli_connection_interface_simple_presence_call_set_presence(data->connection, -1,
-			presence_id, presence_message, 
-			set_presence_cb, data,
-			NULL, NULL);
+	initial_presence = purple_status_to_telepathy_status(
+		purple_account_get_active_status(account));
+
+	tp_cli_dbus_properties_call_set(account_data->tp_account, -1,
+		TP_IFACE_ACCOUNT, "RequestedPresence",
+		tp_g_value_slice_new_boxed(G_TYPE_VALUE_ARRAY, initial_presence),
+		NULL, NULL, NULL, NULL);
+
+	g_value_array_free(initial_presence);
 }
 
 static void


More information about the Commits mailing list