]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-tls-dialog.c
tls-dialog: destroy the dialog if the certificate is invalidated (#643186)
[empathy.git] / libempathy-gtk / empathy-tls-dialog.c
index f09d6c51d4ccbdaf317e0badba47efbfc607592c..8f1f49ed6ec3d245188febf406e9aa2a7311d5bc 100644 (file)
@@ -256,6 +256,16 @@ checkbox_toggled_cb (GtkToggleButton *checkbox,
   g_object_notify (G_OBJECT (self), "remember");
 }
 
+static void
+certificate_invalidated_cb (EmpathyTLSCertificate *certificate,
+    guint domain,
+    gint code,
+    gchar *message,
+    EmpathyTLSDialog *self)
+{
+  gtk_widget_destroy (GTK_WIDGET (self));
+}
+
 static void
 empathy_tls_dialog_constructed (GObject *object)
 {
@@ -310,6 +320,9 @@ empathy_tls_dialog_constructed (GObject *object)
   details = build_gcr_widget (self);
   gtk_container_add (GTK_CONTAINER (expander), details);
   gtk_widget_show (details);
+
+  tp_g_signal_connect_object (priv->certificate, "invalidated",
+      G_CALLBACK (certificate_invalidated_cb), self, 0);
 }
 
 static void