Inbound messages get assigned id and origin-id
Slixmpp version: 0139fb29
Slixmpp seems to be adding an id
attribute and origin-id
tag on messages it receives if they don't already contain an id
.
Here are two examples with poezio outbound and inbound, and prosody in between, without an id
:
OUT: <message to='pep@bouah.net'><body>Foo</body></message>
RECV: <message to='pep@bouah.net' from='pep@cluxia.eu/poezio-yUfy'><body>Foo</body></message>
SENT: <message to='pep@bouah.net' xml:lang='en' from='pep@cluxia.eu/poezio-yUfy'><body>Foo</body><stanza-id id='eVVo97puKGZtHuz3' xmlns='urn:xmpp:sid:0' by='pep@bouah.net'/></message>
IN: <message to="pep@bouah.net" xml:lang="en" from="pep@cluxia.eu/poezio-yUfy" id="78fad86fe2ee446cba959f7c3b4f08d7"><body>Foo</body><stanza-id xmlns="urn:xmpp:sid:0" id="eVVo97puKGZtHuz3" by="pep@bouah.net" /><origin-id xmlns="urn:xmpp:sid:0" id="78fad86fe2ee446cba959f7c3b4f08d7" /></message>
With an id
:
OUT: <message to='pep@bouah.net' id='bar'><body>Foo</body></message>
RECV: <message to='pep@bouah.net' from='pep@cluxia.eu/poezio-yUfy' id='bar'><body>Bar</body></message>
SENT: <message xml:lang='en' id='bar' to='pep@bouah.net' from='pep@cluxia.eu/poezio-yUfy'><body>Bar</body><stanza-id id='RlFD1G4YTuKZHC6I' xmlns='urn:xmpp:sid:0' by='pep@bouah.net'/></message>
IN: <message xml:lang="en" id="bar" to="pep@bouah.net" from="pep@cluxia.eu/poezio-yUfy"><body>Bar</body><stanza-id xmlns="urn:xmpp:sid:0" id="RlFD1G4YTuKZHC6I" by="pep@bouah.net" /></message>
I implemented the origin-id
tag and I added it wherever id
was being added. I don't know if adding id
here is on purpose, can we clarify this first? Is anything going to break if we remove it?
As far as the RFC is concerned, it's a SHOULD, so even if there must be a "good reason" not to put one, receiving code should probably know how to handle this. One might argue we're the receiving code and we're handling it for the client though.
As for origin-id
, it should certainly be removed in this case, independently of what we do with id
.