aboutsummaryrefslogtreecommitdiff
path: root/src/server/QXmppIncomingClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/QXmppIncomingClient.cpp')
-rw-r--r--src/server/QXmppIncomingClient.cpp37
1 files changed, 9 insertions, 28 deletions
diff --git a/src/server/QXmppIncomingClient.cpp b/src/server/QXmppIncomingClient.cpp
index 1ddb6f84..de27d3e2 100644
--- a/src/server/QXmppIncomingClient.cpp
+++ b/src/server/QXmppIncomingClient.cpp
@@ -1,25 +1,6 @@
-/*
- * Copyright (C) 2008-2021 The QXmpp developers
- *
- * Author:
- * Jeremy Lainé
- *
- * Source:
- * https://github.com/qxmpp-project/qxmpp
- *
- * This file is a part of QXmpp library.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- */
+// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
#include "QXmppIncomingClient.h"
@@ -293,7 +274,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv)
// authentication succeeded
d->jid = QString("%1@%2").arg(d->saslServer->username(), d->domain);
info(QString("Authentication succeeded for '%1' from %2").arg(d->jid, d->origin()));
- updateCounter("incoming-client.auth.success");
+ emit updateCounter("incoming-client.auth.success");
sendPacket(QXmppSaslSuccess());
handleStart();
} else {
@@ -378,7 +359,7 @@ void QXmppIncomingClient::onDigestReply()
if (reply->error() == QXmppPasswordReply::TemporaryError) {
warning(QString("Temporary authentication failure for '%1' from %2").arg(d->saslServer->username(), d->origin()));
- updateCounter("incoming-client.auth.temporary-auth-failure");
+ emit updateCounter("incoming-client.auth.temporary-auth-failure");
sendPacket(QXmppSaslFailure("temporary-auth-failure"));
disconnectFromHost();
return;
@@ -390,7 +371,7 @@ void QXmppIncomingClient::onDigestReply()
QXmppSaslServer::Response result = d->saslServer->respond(reply->property("__sasl_raw").toByteArray(), challenge);
if (result != QXmppSaslServer::Challenge) {
warning(QString("Authentication failed for '%1' from %2").arg(d->saslServer->username(), d->origin()));
- updateCounter("incoming-client.auth.not-authorized");
+ emit updateCounter("incoming-client.auth.not-authorized");
sendPacket(QXmppSaslFailure("not-authorized"));
disconnectFromHost();
return;
@@ -412,19 +393,19 @@ void QXmppIncomingClient::onPasswordReply()
case QXmppPasswordReply::NoError:
d->jid = jid;
info(QString("Authentication succeeded for '%1' from %2").arg(d->jid, d->origin()));
- updateCounter("incoming-client.auth.success");
+ emit updateCounter("incoming-client.auth.success");
sendPacket(QXmppSaslSuccess());
handleStart();
break;
case QXmppPasswordReply::AuthorizationError:
warning(QString("Authentication failed for '%1' from %2").arg(jid, d->origin()));
- updateCounter("incoming-client.auth.not-authorized");
+ emit updateCounter("incoming-client.auth.not-authorized");
sendPacket(QXmppSaslFailure("not-authorized"));
disconnectFromHost();
break;
case QXmppPasswordReply::TemporaryError:
warning(QString("Temporary authentication failure for '%1' from %2").arg(jid, d->origin()));
- updateCounter("incoming-client.auth.temporary-auth-failure");
+ emit updateCounter("incoming-client.auth.temporary-auth-failure");
sendPacket(QXmppSaslFailure("temporary-auth-failure"));
disconnectFromHost();
break;