Fix TLS error notification wrongly appearing

This commit is contained in:
fiaxh 2018-11-17 11:02:54 +01:00
parent 7497f1f17b
commit 45d89326b8

View file

@ -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 });