diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-04-20 15:21:56 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-04-20 15:21:56 +0000 |
| commit | 7de79b51bb991b6d237522d3d30c73127dedbfa6 (patch) | |
| tree | 8f4c38bba237fb02be1f35ad9208fef06d4e38e3 /src/server/QXmppIncomingClient.cpp | |
| parent | d648473c16ac3fe5ce4f4b79c188b9bade381425 (diff) | |
encapsulate QXmppUtils methods in a QXmppUtils class
Diffstat (limited to 'src/server/QXmppIncomingClient.cpp')
| -rw-r--r-- | src/server/QXmppIncomingClient.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/QXmppIncomingClient.cpp b/src/server/QXmppIncomingClient.cpp index 7338115a..c5be0f33 100644 --- a/src/server/QXmppIncomingClient.cpp +++ b/src/server/QXmppIncomingClient.cpp @@ -139,7 +139,7 @@ void QXmppIncomingClient::handleStream(const QDomElement &streamElement) d->saslDigestUsername.clear(); // start stream - const QByteArray sessionId = generateStanzaHash().toAscii(); + const QByteArray sessionId = QXmppUtils::generateStanzaHash().toAscii(); QString response = QString("<?xml version='1.0'?><stream:stream" " xmlns=\"%1\" xmlns:stream=\"%2\"" " id=\"%3\" from=\"%4\" version=\"1.0\" xml:lang=\"en\">").arg( @@ -303,7 +303,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv) bindSet.parse(nodeRecv); d->resource = bindSet.resource().trimmed(); if (d->resource.isEmpty()) - d->resource = generateStanzaHash(); + d->resource = QXmppUtils::generateStanzaHash(); d->jid = QString("%1@%2/%3").arg(d->username, d->domain, d->resource); QXmppBindIq bindResult; @@ -332,7 +332,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv) // check the sender is legitimate const QString from = nodeRecv.attribute("from"); - if (!from.isEmpty() && from != d->jid && from != jidToBareJid(d->jid)) + if (!from.isEmpty() && from != d->jid && from != QXmppUtils::jidToBareJid(d->jid)) { warning(QString("Received a stanza from unexpected JID %1").arg(from)); return; @@ -351,7 +351,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv) if (nodeFull.tagName() == QLatin1String("presence") && (nodeFull.attribute("type") == QLatin1String("subscribe") || nodeFull.attribute("type") == QLatin1String("subscribed"))) - nodeFull.setAttribute("from", jidToBareJid(d->jid)); + nodeFull.setAttribute("from", QXmppUtils::jidToBareJid(d->jid)); else nodeFull.setAttribute("from", d->jid); } |
