aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppOutgoingClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
-rw-r--r--src/client/QXmppOutgoingClient.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index 046bdcf2..19895938 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -324,11 +324,9 @@ bool QXmppOutgoingClient::isStreamResumed() const
///
QXmppTask<QXmppStream::IqResult> QXmppOutgoingClient::sendIq(QXmppIq &&iq)
{
- // always set a to address (the QXmppStream needs this for matching)
- if (iq.to().isEmpty()) {
- iq.setTo(d->config.domain());
- }
- return QXmppStream::sendIq(std::move(iq));
+ // If 'to' is empty the user's bare JID is meant implicitly (see RFC6120, section 10.3.3.).
+ auto to = iq.to();
+ return QXmppStream::sendIq(std::move(iq), to.isEmpty() ? d->config.jidBare() : to);
}
void QXmppOutgoingClient::_q_socketDisconnected()