From 45d89326b8bf9cd8eb398a87a8e572630d911f97 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 17 Nov 2018 11:02:54 +0100 Subject: [PATCH] Fix TLS error notification wrongly appearing --- libdino/src/service/connection_manager.vala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libdino/src/service/connection_manager.vala b/libdino/src/service/connection_manager.vala index 6a7964a0..67763ad3 100644 --- a/libdino/src/service/connection_manager.vala +++ b/libdino/src/service/connection_manager.vala @@ -168,7 +168,9 @@ public class ConnectionManager : Object { }); stream.get_module(Sasl.Module.IDENTITY).received_auth_failure.connect((stream, node) => { set_connection_error(account, new ConnectionError(ConnectionError.Source.SASL, null)); - change_connection_state(account, ConnectionState.DISCONNECTED); + }); + stream.get_module(Tls.Module.IDENTITY).invalid_certificate.connect(() => { + set_connection_error(account, new ConnectionError(ConnectionError.Source.TLS, null) { reconnect_recomendation=ConnectionError.Reconnect.NEVER}); }); stream.received_node.connect(() => { connections[account].last_activity = new DateTime.now_utc(); @@ -188,10 +190,6 @@ public class ConnectionManager : Object { if (!connection_todo.contains(account)) { return; } - if (e is IOStreamError.TLS) { - set_connection_error(account, new ConnectionError(ConnectionError.Source.TLS, e.message) { reconnect_recomendation=ConnectionError.Reconnect.NEVER}); - return; - } StreamError.Flag? flag = stream.get_flag(StreamError.Flag.IDENTITY); if (flag != null) { set_connection_error(account, new ConnectionError(ConnectionError.Source.STREAM_ERROR, flag.error_type) { resource_rejected=flag.resource_rejected });