diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-19 00:11:42 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-19 01:19:00 +0800 |
commit | 61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1 (patch) | |
tree | 7be78425ae76a1bce414548cfa811410774449d1 /libempathy-gtk/empathy-tls-dialog.c | |
parent | d7d8916076c8dcca1b1d95f090444cc6e7a05cd6 (diff) | |
download | gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar.gz gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar.bz2 gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar.lz gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar.xz gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.tar.zst gsoc2013-empathy-61e8bd3c9fec6cef2aa65cdaef98a383f346dcf1.zip |
Use the hostname properties in the dialog
Diffstat (limited to 'libempathy-gtk/empathy-tls-dialog.c')
-rw-r--r-- | libempathy-gtk/empathy-tls-dialog.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-tls-dialog.c b/libempathy-gtk/empathy-tls-dialog.c index 9a2dfd6fc..bcfe92e65 100644 --- a/libempathy-gtk/empathy-tls-dialog.c +++ b/libempathy-gtk/empathy-tls-dialog.c @@ -135,12 +135,17 @@ empathy_tls_dialog_finalize (GObject *object) } static gchar * -reason_to_string (EmpTLSCertificateRejectReason reason) +reason_to_string (EmpathyTLSDialog *self) { GString *str; const gchar *reason_str; + EmpTLSCertificateRejectReason reason; + GHashTable *details; + EmpathyTLSDialogPriv *priv = GET_PRIV (self); str = g_string_new (NULL); + reason = priv->reason; + details = priv->details; g_string_append (str, _("The identity provided by the chat server cannot be " "verified.\n")); @@ -183,7 +188,27 @@ reason_to_string (EmpTLSCertificateRejectReason reason) break; } - g_string_append (str, reason_str); + g_string_append_printf (str, "%s.", reason_str); + + /* add more information in case of HOSTNAME_MISMATCH */ + if (reason == EMP_TLS_CERTIFICATE_REJECT_REASON_HOSTNAME_MISMATCH) + { + const gchar *expected_hostname, *certificate_hostname; + + expected_hostname = tp_asv_get_string (details, "expected-hostname"); + certificate_hostname = tp_asv_get_string (details, + "certificate-hostname"); + + if (expected_hostname != NULL && certificate_hostname != NULL) + { + g_string_append (str, "\n"); + g_string_append_printf (str, _("Expected hostname: %s"), + expected_hostname); + g_string_append (str, "\n"); + g_string_append_printf (str, _("Certificate hostname: %s"), + certificate_hostname); + } + } return g_string_free (str, FALSE); } @@ -238,7 +263,7 @@ empathy_tls_dialog_constructed (GObject *object) _("Continue"), GTK_RESPONSE_YES, NULL); - text = reason_to_string (priv->reason); + text = reason_to_string (self); g_object_set (message_dialog, "text", _("This connection is untrusted, would you like to " |