aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppIncomingClient.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-24 13:29:56 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-24 13:29:56 +0000
commitf563a0dcceb2b9a63d2d0a483dde668b5172add9 (patch)
tree44e36f64f658cbd0393ef9893bcd11f7c1808b6f /src/QXmppIncomingClient.cpp
parentbe8cbbda831ead579f40e87fe9d103a9c6394521 (diff)
downloadqxmpp-f563a0dcceb2b9a63d2d0a483dde668b5172add9.tar.gz
when an element is received from a client without a "to", set the "to" to the local domain
Diffstat (limited to 'src/QXmppIncomingClient.cpp')
-rw-r--r--src/QXmppIncomingClient.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/QXmppIncomingClient.cpp b/src/QXmppIncomingClient.cpp
index 1e9cd3e5..1a8f4f3c 100644
--- a/src/QXmppIncomingClient.cpp
+++ b/src/QXmppIncomingClient.cpp
@@ -285,6 +285,9 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv)
{
QDomElement nodeFull(nodeRecv);
nodeFull.setAttribute("from", jid());
+ // if the recipient is empty, set it to the local domain
+ if (nodeFull.attribute("to").isEmpty())
+ nodeFull.setAttribute("to", d->domain);
bool handled = false;
emit elementReceived(nodeFull, handled);
}
@@ -293,6 +296,9 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv)
{
QDomElement nodeFull(nodeRecv);
nodeFull.setAttribute("from", jid());
+ // if the recipient is empty, set it to the local domain
+ if (nodeFull.attribute("to").isEmpty())
+ nodeFull.setAttribute("to", d->domain);
bool handled = false;
emit elementReceived(nodeFull, handled);
}