aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2023-03-14 23:18:47 +0100
committerLinus Jahn <lnj@kaidan.im>2023-03-14 23:31:51 +0100
commit98abdcac77c5fbf47ac955645995d9ff83c2a98b (patch)
tree67a176f4ee3f8cad91550817b5e82345e02ad714
parent7bfb39fe1eb853a95929c16a2692cbb648d7387c (diff)
Client: Fix empty to in IQs is interpreted as server domain
Empty to means account bare JID.
-rw-r--r--src/client/QXmppOutgoingClient.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index 53c02e41..4aaed0e7 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -328,8 +328,9 @@ bool QXmppOutgoingClient::isStreamResumed() const
///
QXmppTask<QXmppStream::IqResult> QXmppOutgoingClient::sendIq(QXmppIq &&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.domain() : to);
+ return QXmppStream::sendIq(std::move(iq), to.isEmpty() ? d->config.jidBare() : to);
}
void QXmppOutgoingClient::_q_socketDisconnected()