aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-01-04 21:13:44 +0100
committerfiaxh <git@mx.ax.lt>2018-01-04 21:17:56 +0100
commita8cc94c188c085e8788e072017ef21d7b7812a55 (patch)
treef537499e6106144a0b6dd756d25d4d6252f146fe /main/src
parent6b58b348fa42c3206f56c4b897a255d81f0ea7a9 (diff)
downloaddino-a8cc94c188c085e8788e072017ef21d7b7812a55.tar.gz
dino-a8cc94c188c085e8788e072017ef21d7b7812a55.zip
Show error on invalid TLS certificate
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/manage_accounts/dialog.vala13
1 files changed, 9 insertions, 4 deletions
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index dd2383a2..b157a936 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -171,7 +171,7 @@ public class Dialog : Gtk.Dialog {
}
}
- private bool on_active_switch_state_changed(bool state) {
+ private bool change_account_state(bool state) {
selected_account.enabled = state;
if (state) {
if (selected_account.enabled) account_disabled(selected_account);
@@ -189,7 +189,7 @@ public class Dialog : Gtk.Dialog {
}
private void populate_grid_data(Account account) {
- active_switch.state_set.disconnect(on_active_switch_state_changed);
+ active_switch.state_set.disconnect(change_account_state);
Util.image_set_from_scaled_pixbuf(image, (new AvatarGenerator(50, 50, image.scale_factor)).draw_account(stream_interactor, account));
active_switch.set_active(account.enabled);
@@ -201,7 +201,7 @@ public class Dialog : Gtk.Dialog {
update_status_label(account);
- active_switch.state_set.connect(on_active_switch_state_changed);
+ active_switch.state_set.connect(change_account_state);
foreach(Plugins.AccountSettingsWidget widget in plugin_widgets) {
widget.set_account(account);
@@ -216,8 +216,11 @@ public class Dialog : Gtk.Dialog {
state_label.get_style_context().add_class("is_error");
if (error.source == ConnectionManager.ConnectionError.Source.SASL ||
- (error.flag != null && error.flag.reconnection_recomendation == Xmpp.StreamError.Flag.Reconnect.NEVER)) {
+ error.source == ConnectionManager.ConnectionError.Source.TLS ||
+ error.reconnect_recomendation == ConnectionManager.ConnectionError.Reconnect.NEVER) {
+ active_switch.state_set.disconnect(change_account_state);
active_switch.active = false;
+ active_switch.state_set.connect(change_account_state);
}
} else {
@@ -238,6 +241,8 @@ public class Dialog : Gtk.Dialog {
switch (error.source) {
case ConnectionManager.ConnectionError.Source.SASL:
return _("Wrong password");
+ case ConnectionManager.ConnectionError.Source.TLS:
+ return _("Invalid TLS certificate");
}
if (error.identifier != null) {
return _("Error") + ": " + error.identifier;