From f563a0dcceb2b9a63d2d0a483dde668b5172add9 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Tue, 24 Aug 2010 13:29:56 +0000 Subject: when an element is received from a client without a "to", set the "to" to the local domain --- src/QXmppIncomingClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/QXmppIncomingClient.cpp') 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); } -- cgit v1.2.3