aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-account.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:18:56 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-08 23:18:56 +0800
commit6389342273e991e9b4c17d15fe82b709801a6983 (patch)
treef00c7791d2db8e246c6e2650325d7ade2b0b1803 /libempathy/empathy-account.c
parent96fad6a1159582a3e8792dd3308ce1fbeb178234 (diff)
downloadgsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar.gz
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar.bz2
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar.lz
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar.xz
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.tar.zst
gsoc2013-empathy-6389342273e991e9b4c17d15fe82b709801a6983.zip
Add api to set the requested presence
Diffstat (limited to 'libempathy/empathy-account.c')
-rw-r--r--libempathy/empathy-account.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/libempathy/empathy-account.c b/libempathy/empathy-account.c
index 010990d7a..d965fac62 100644
--- a/libempathy/empathy-account.c
+++ b/libempathy/empathy-account.c
@@ -848,6 +848,49 @@ empathy_account_set_enabled (EmpathyAccount *account,
g_object_notify (G_OBJECT (account), "enabled");
}
+static void
+empathy_account_requested_presence_cb (TpProxy *proxy,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
+{
+ if (error)
+ DEBUG (":( : %s", error->message);
+}
+
+
+void
+empathy_account_request_presence (EmpathyAccount *account,
+ TpConnectionPresenceType type,
+ const gchar *status,
+ const gchar *message)
+{
+ EmpathyAccountPriv *priv = GET_PRIV (account);
+ GValue value = {0, };
+ GValueArray *arr;
+
+ g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE);
+ g_value_take_boxed (&value, dbus_g_type_specialized_construct
+ (TP_STRUCT_TYPE_SIMPLE_PRESENCE));
+ arr = (GValueArray *) g_value_get_boxed (&value);
+
+ g_value_set_uint (arr->values, type);
+ g_value_set_static_string (arr->values + 1, status);
+ g_value_set_static_string (arr->values + 2, message);
+
+ tp_cli_dbus_properties_call_set (TP_PROXY (priv->account),
+ -1,
+ TP_IFACE_ACCOUNT,
+ "RequestedPresence",
+ &value,
+ empathy_account_requested_presence_cb,
+ NULL,
+ NULL,
+ G_OBJECT (account));
+
+ g_value_unset (&value);
+}
+
#if 0
McAccount *
_empathy_account_get_mc_account (EmpathyAccount *account)