]> git.0d.be Git - empathy.git/commitdiff
Password infobar amendments
authorChandni Verma <chandniverma2112@gmail.com>
Sun, 8 May 2011 23:22:16 +0000 (04:52 +0530)
committerChandni Verma <chandniverma2112@gmail.com>
Wed, 11 May 2011 09:39:33 +0000 (15:09 +0530)
Destroy password infobar on parting password protected chatrooms and
insensitivate input-text-view when displaying a new infobar

libempathy-gtk/empathy-chat.c

index 0b61d53f5f103e79651a35901d76552d959f8694..b2d091518ece2f9f762f65f9d307fd2141d2d728 100644 (file)
@@ -3287,6 +3287,18 @@ password_entry_changed_cb (GtkEditable *entry,
            GTK_ENTRY_ICON_SECONDARY, !EMP_STR_EMPTY (str));
 }
 
+static void
+chat_invalidated_cb (TpProxy       *proxy,
+                          guint          domain,
+                          gint           code,
+                          gchar         *message,
+                          gpointer       password_infobar)
+{
+       /* Destroy the password infobar whenever a channel is invalidated
+        * so we don't have multiple infobars when the MUC is rejoined */
+       gtk_widget_destroy (GTK_WIDGET (password_infobar));
+}
+
 static void
 display_password_info_bar (EmpathyChat *self)
 {
@@ -3369,12 +3381,19 @@ display_password_info_bar (EmpathyChat *self)
                            TRUE, TRUE, 3);
        gtk_widget_show_all (hbox);
 
+       tp_g_signal_connect_object (empathy_tp_chat_get_channel (priv->tp_chat),
+                                 "invalidated", G_CALLBACK (chat_invalidated_cb),
+                                 info_bar, 0);
+
        data->response_id = g_signal_connect (info_bar, "response",
                                              G_CALLBACK (password_infobar_response_cb), data);
 
        gtk_widget_show_all (info_bar);
        /* ... but hide the spinner */
        gtk_widget_hide (spinner);
+
+       /* prevent the user from typing anything */
+       gtk_widget_set_sensitive (self->input_text_view, FALSE);
 }
 
 static void