Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

QXmppServer: Route stanza for a bare jid to specific resource #7

Open
ghost opened this issue May 8, 2014 · 0 comments · May be fixed by #76
Open

QXmppServer: Route stanza for a bare jid to specific resource #7

ghost opened this issue May 8, 2014 · 0 comments · May be fixed by #76

Comments

@ghost
Copy link

ghost commented May 8, 2014

As far as I can see, it isn't possible to tell the QXmppServer to route a stanza with a bare JID in the 'to' attribute to a specific resource without changing the 'to' attribute.

If I want to route a message only to the resource with the highest presence priority or the most recently used resource, I must not change the 'to' attribute as stated in RFC 6121 chapter 8.5.2.1.1 (Server Rules for Processing XML Stanzas / Local User / Avalable or Connected Resource / Message) last paragraph:

In all cases, the server MUST NOT rewrite the 'to' attribute (i.e.,
it MUST leave it as <localpart@domainpart> rather than change it to
<localpart@domainpart/resourcepart>).

So this cannot be achieved with QXmppServer. I think that could easily be achieved by either adding a 2nd Parameter const QString& resource = QString() to sendElement(...) and sendPacket(...)

bool sendElement(const QDomElement &element, const QString& resource = QString());
bool sendPacket(const QXmppStanza &stanza, const QString& resource = QString());

or by providing overloaded methods

bool sendElement(const QDomElement &element);
bool sendElement(const QString& resource, const QDomElement &element);
bool sendPacket(const QXmppStanza &stanza);
bool sendPacket(const QString& resource, const QXmppStanza &stanza);

As I don't know the ideas / architecture / coding rules behind qxmpp I cannot estimate whether any of the suggestions would fit or whether it could cause problems.

Currently I think it would be enough to only add the possibility to just specify the resource but maybe someone can think of a use case for specifying the full JID.

ricardomv referenced this issue in ricardomv/qxmpp Jan 2, 2015
Added error code to QmlQXmppClient::error() signal
servonic added a commit to servonic/qxmpp that referenced this issue Sep 22, 2015
…urce without the need to add the resource to the stanza's JID. Closes qxmpp-project#7
servonic added a commit to servonic/qxmpp that referenced this issue Jan 5, 2016
…urce without the need to add the resource to the stanza's JID. Closes qxmpp-project#7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants