From 98abdcac77c5fbf47ac955645995d9ff83c2a98b Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Tue, 14 Mar 2023 23:18:47 +0100 Subject: Client: Fix empty to in IQs is interpreted as server domain Empty to means account bare JID. --- src/client/QXmppOutgoingClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client') 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 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() -- cgit v1.2.3