Commit 0d187ae1 authored by Melvin Keskin's avatar Melvin Keskin Committed by Linus Jahn

ClientWorker: Fix wrong indentation introduced in !443

Signed-off-by: Linus Jahn's avatarLinus Jahn <lnj@kaidan.im>
parent 3e1ac411
......@@ -147,49 +147,49 @@ void ClientWorker::onConnectionError(QXmppClient::Error error)
}
QXmppStanza::Error::Condition xmppStreamError;
QAbstractSocket::SocketError socketError;
switch (error) {
case QXmppClient::NoError:
emit connectionErrorChanged(ClientWorker::UserDisconnected);
QAbstractSocket::SocketError socketError;
switch (error) {
case QXmppClient::NoError:
emit connectionErrorChanged(ClientWorker::UserDisconnected);
break;
case QXmppClient::KeepAliveError:
emit connectionErrorChanged(ClientWorker::KeepAliveError);
break;
case QXmppClient::XmppStreamError:
xmppStreamError = client->xmppStreamError();
qDebug() << xmppStreamError;
if (xmppStreamError == QXmppStanza::Error::NotAuthorized) {
emit connectionErrorChanged(ClientWorker::AuthenticationFailed);
} else {
emit connectionErrorChanged(ClientWorker::NotConnected);
}
break;
case QXmppClient::SocketError:
socketError = client->socketError();
switch (socketError) {
case QAbstractSocket::ConnectionRefusedError:
case QAbstractSocket::RemoteHostClosedError:
emit connectionErrorChanged(ClientWorker::ConnectionRefused);
break;
case QXmppClient::KeepAliveError:
emit connectionErrorChanged(ClientWorker::KeepAliveError);
case QAbstractSocket::HostNotFoundError:
emit connectionErrorChanged(ClientWorker::DnsError);
break;
case QXmppClient::XmppStreamError:
xmppStreamError = client->xmppStreamError();
qDebug() << xmppStreamError;
if (xmppStreamError == QXmppStanza::Error::NotAuthorized) {
emit connectionErrorChanged(ClientWorker::AuthenticationFailed);
} else {
emit connectionErrorChanged(ClientWorker::NotConnected);
}
case QAbstractSocket::SocketAccessError:
emit connectionErrorChanged(ClientWorker::NoNetworkPermission);
break;
case QXmppClient::SocketError:
socketError = client->socketError();
switch (socketError) {
case QAbstractSocket::ConnectionRefusedError:
case QAbstractSocket::RemoteHostClosedError:
emit connectionErrorChanged(ClientWorker::ConnectionRefused);
break;
case QAbstractSocket::HostNotFoundError:
emit connectionErrorChanged(ClientWorker::DnsError);
break;
case QAbstractSocket::SocketAccessError:
emit connectionErrorChanged(ClientWorker::NoNetworkPermission);
break;
case QAbstractSocket::SocketTimeoutError:
emit connectionErrorChanged(ClientWorker::KeepAliveError);
break;
case QAbstractSocket::SslHandshakeFailedError:
case QAbstractSocket::SslInternalError:
emit connectionErrorChanged(ClientWorker::TlsFailed);
break;
default:
emit connectionErrorChanged(ClientWorker::NotConnected);
}
case QAbstractSocket::SocketTimeoutError:
emit connectionErrorChanged(ClientWorker::KeepAliveError);
break;
case QAbstractSocket::SslHandshakeFailedError:
case QAbstractSocket::SslInternalError:
emit connectionErrorChanged(ClientWorker::TlsFailed);
break;
default:
emit connectionErrorChanged(ClientWorker::NotConnected);
}
break;
}
}
QString ClientWorker::generateRandomString(unsigned int length) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment