aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-11 23:15:39 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-13 23:59:22 +0800
commit279e787b1634fdd3269cb28f0562b9bcca79e496 (patch)
tree6ddf03a1e1bc105a03cc073bf683af698c65ff41 /libempathy/empathy-tp-chat.c
parent1b95421ff7aff636a202763d996fd247d3b73ee3 (diff)
downloadgsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar.gz
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar.bz2
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar.lz
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar.xz
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.tar.zst
gsoc2013-empathy-279e787b1634fdd3269cb28f0562b9bcca79e496.zip
tp-chat: update the 'password-needed' property when password flags changes
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r--libempathy/empathy-tp-chat.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index c0c6eb66e..9a235b70e 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -1047,6 +1047,28 @@ tp_chat_got_self_contact_cb (EmpathyTpContactFactory *factory,
}
static void
+password_flags_changed_cb (TpChannel *channel,
+ guint added,
+ guint removed,
+ gpointer user_data,
+ GObject *weak_object)
+{
+ EmpathyTpChat *self = EMPATHY_TP_CHAT (weak_object);
+ EmpathyTpChatPriv *priv = GET_PRIV (self);
+ gboolean was_needed, needed;
+
+ was_needed = empathy_tp_chat_password_needed (self);
+
+ priv->password_flags |= added;
+ priv->password_flags ^= removed;
+
+ needed = empathy_tp_chat_password_needed (self);
+
+ if (was_needed != needed)
+ g_object_notify (G_OBJECT (self), "password-needed");
+}
+
+static void
got_password_flags_cb (TpChannel *proxy,
guint password_flags,
const GError *error,
@@ -1136,6 +1158,11 @@ tp_chat_constructor (GType type,
if (tp_proxy_has_interface_by_id (priv->channel,
TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD)) {
priv->got_password_flags = FALSE;
+
+ tp_cli_channel_interface_password_connect_to_password_flags_changed (
+ priv->channel, password_flags_changed_cb, chat, NULL,
+ G_OBJECT (chat), NULL);
+
tp_cli_channel_interface_password_call_get_password_flags (priv->channel,
-1, got_password_flags_cb, chat, NULL, chat);
} else {