From 2823db87b082e0a0367b0cc53afc070e030c80c0 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Fri, 6 Sep 2024 03:10:14 +0200 Subject: [PATCH] RegistrationManager: Handle failing registration form request This is needed if the server does not respond with a registration form. That can be the case if too many CAPTCHAs were not solved. --- src/client/QXmppRegistrationManager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/client/QXmppRegistrationManager.cpp b/src/client/QXmppRegistrationManager.cpp index 107f7f17f..03a981954 100644 --- a/src/client/QXmppRegistrationManager.cpp +++ b/src/client/QXmppRegistrationManager.cpp @@ -282,7 +282,20 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) QXmppRegisterIq iq; iq.parse(stanza); - Q_EMIT registrationFormReceived(iq); + switch (iq.type()) { + case QXmppIq::Result: + info(u"Received registration form."_s); + Q_EMIT registrationFormReceived(iq); + break; + case QXmppIq::Error: + warning(u"Registration form could not be received: "_s.append(iq.error().text())); + Q_EMIT registrationFailed(iq.error()); + break; + default: + break; // should never occur + } + + return true; } } return false;