aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-11 20:23:11 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-11 20:23:11 +0800
commit9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04 (patch)
tree08a40f03cfce73709905c1784bd52c71c6deb9a8 /libempathy
parenteeae2f62192b97d5509ae16ae6cabbe29ef5c455 (diff)
downloadgsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar.gz
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar.bz2
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar.lz
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar.xz
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.tar.zst
gsoc2013-empathy-9f6aadfcfb2dcf2b888a8843b32f76d97c1a0c04.zip
Connect to PropertyFlagsChanged
svn path=/trunk/; revision=775
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-chat.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index dc90f28e2..4d207c4e0 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -388,6 +388,42 @@ tp_chat_list_pending_messages_cb (TpChannel *channel,
}
static void
+tp_chat_property_flags_changed_cb (TpProxy *proxy,
+ const GPtrArray *properties,
+ gpointer user_data,
+ GObject *chat)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ guint i, j;
+
+ if (!priv->had_properties_list || !properties) {
+ return;
+ }
+
+ for (i = 0; i < properties->len; i++) {
+ GValueArray *prop_struct;
+ TpChatProperty *property;
+ guint id;
+ guint flags;
+
+ prop_struct = g_ptr_array_index (properties, i);
+ id = g_value_get_uint (g_value_array_get_nth (prop_struct, 0));
+ flags = g_value_get_uint (g_value_array_get_nth (prop_struct, 1));
+
+ for (j = 0; j < priv->properties->len; j++) {
+ property = g_ptr_array_index (priv->properties, j);
+ if (property->id == id) {
+ property->flags = flags;
+ empathy_debug (DEBUG_DOMAIN,
+ "property %s flags changed: %d",
+ property->name, property->flags);
+ break;
+ }
+ }
+ }
+}
+
+static void
tp_chat_properties_changed_cb (TpProxy *proxy,
const GPtrArray *properties,
gpointer user_data,
@@ -586,6 +622,10 @@ tp_chat_channel_ready_cb (EmpathyTpChat *chat)
tp_chat_properties_changed_cb,
NULL, NULL,
G_OBJECT (chat), NULL);
+ tp_cli_properties_interface_connect_to_property_flags_changed (priv->channel,
+ tp_chat_property_flags_changed_cb,
+ NULL, NULL,
+ G_OBJECT (chat), NULL);
return FALSE;
}