Skip to content

Commit

Permalink
Merge branch '1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
lnjX committed Feb 13, 2024
2 parents 230a96f + 40528ef commit efe8685
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/client/QXmppOutgoingClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,15 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv)
} else if (ns == ns_stream && nodeRecv.tagName() == "error") {
// handle redirects
const auto otherHost = nodeRecv.firstChildElement("see-other-host");
if (!otherHost.isNull() && setResumeAddress(otherHost.text())) {
QXmppStream::disconnectFromHost();
return;
if (!otherHost.isNull()) {
// try to parse address
if (auto [host, port] = parseHostAddress(otherHost.text()); !host.isEmpty()) {
d->redirectHost = host;
d->redirectPort = port > 0 ? port : 5222;

QXmppStream::disconnectFromHost();
return;
}
}

if (!nodeRecv.firstChildElement("conflict").isNull()) {
Expand Down

0 comments on commit efe8685

Please sign in to comment.