Skip to content

Commit

Permalink
RegistrationManager: Handle failing registration form request
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
melvo committed Sep 30, 2024
1 parent 6cee87f commit 8cc6c41
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/client/QXmppRegistrationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8cc6c41

Please sign in to comment.