aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-11 23:16:29 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-13 23:59:22 +0800
commit77cd05e44a390273974fbb53266b0173a9ac7368 (patch)
tree0bd0873a40362fe89a72037645949f2c6cb32184 /libempathy-gtk
parent279e787b1634fdd3269cb28f0562b9bcca79e496 (diff)
downloadgsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar.gz
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar.bz2
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar.lz
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar.xz
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.tar.zst
gsoc2013-empathy-77cd05e44a390273974fbb53266b0173a9ac7368.zip
empathy-chat: watch for password-needed property changes
This is needed when we are invited to a protected room. The channel is created without the password requiered flag and then is updated once we accept the invitation.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index e64a90a16..dc332c6d9 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -2458,6 +2458,17 @@ display_password_info_bar (EmpathyChat *self,
gtk_widget_show_all (info_bar);
}
+static void
+chat_password_needed_changed_cb (EmpathyChat *self)
+{
+ EmpathyChatPriv *priv = GET_PRIV (self);
+
+ if (empathy_tp_chat_password_needed (priv->tp_chat)) {
+ display_password_info_bar (self, FALSE);
+ gtk_widget_set_sensitive (priv->hpaned, FALSE);
+ }
+}
+
void
empathy_chat_set_tp_chat (EmpathyChat *chat,
EmpathyTpChat *tp_chat)
@@ -2503,6 +2514,9 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
g_signal_connect_swapped (tp_chat, "notify::remote-contact",
G_CALLBACK (chat_remote_contact_changed_cb),
chat);
+ g_signal_connect_swapped (tp_chat, "notify::password-needed",
+ G_CALLBACK (chat_password_needed_changed_cb),
+ chat);
/* Get initial value of properties */
properties = empathy_tp_chat_get_properties (priv->tp_chat);
@@ -2541,10 +2555,8 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
* been created */
show_pending_messages (chat);
- if (empathy_tp_chat_password_needed (tp_chat)) {
- display_password_info_bar (chat, FALSE);
- gtk_widget_set_sensitive (priv->hpaned, FALSE);
- }
+ /* check if a password is needed */
+ chat_password_needed_changed_cb (chat);
}
TpAccount *