diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-03 06:39:30 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-03 06:39:30 +0200 |
| commit | 2e95b3d002ef4bc50a239f21118165d3c6bd1f72 (patch) | |
| tree | 1533b078ab80c083c030e7de9fa50344d163a446 /src/client/QXmppOutgoingClient.cpp | |
| parent | fb7ff81285b0d42071b4b211bd15c43800f7d180 (diff) | |
| download | qxmpp-2e95b3d002ef4bc50a239f21118165d3c6bd1f72.tar.gz | |
handle port in see-other-host
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
| -rw-r--r-- | src/client/QXmppOutgoingClient.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 50d2d110..3c480155 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -430,7 +430,10 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) QRegExp redirectRegex("([^:]+)(:[0-9]+)?"); if (redirectRegex.exactMatch(nodeRecv.firstChildElement("see-other-host").text())) { d->redirectHost = redirectRegex.cap(0); - d->redirectPort = 5222; //hostPort.size() > 1 ? hostPort[1].toUShort() : 5222; + if (!redirectRegex.cap(2).isEmpty()) + d->redirectPort = redirectRegex.cap(2).mid(1).toUShort(); + else + d->redirectPort = 5222; disconnectFromHost(); return; } |
