Messages from a MUC domain are silently dropped if they are received via carbon copy
Problem description
Messages of type "normal" and "chat" (others may apply too) which are sent from a MUC domain and delivered to Poezio via Carbons are not shown, at all. They are silently dropped. There is nothing written to errors.log.
Examples
(Note that I redacted my JIDs to be user@example/poezio
and user@example/other-client
. I also reformatted the XML for readability.)
Message which was shown (Directly, from MUC domain)
<message from="muc.poez.io" type="normal" to="user@example.com/poezio" id="f5bbed2d-3922-411b-be8b-c3caeb37b340-8A8E3">
<body>Hello</body>
<stanza-id xmlns="urn:xmpp:sid:0" by="user@example.com" id="2019-10-05-c8914a4d38e73c63" />
</message>
Message which was shown (Carbon-copied, from non-MUC domain)
<message from="user@example.com" type="normal" to="user@example.com/poezio" id="f5bbed2d-3922-411b-be8b-c3caeb37b340-8A8F4">
<received xmlns="urn:xmpp:carbons:2">
<forwarded xmlns="urn:xmpp:forward:0">
<message xmlns="jabber:client" to="user@example.com/other-client" from="example.com" type="normal">
<body>Hello</body>
<stanza-id xmlns="urn:xmpp:sid:0" by="user@example.com" id="2019-10-05-f33935a3d2b1ac22" />
</message>
</forwarded>
</received>
</message>
Message which was not shown (Carbon-copied, from MUC domain)
<message from="user@example.com" type="normal" to="user@example.com/poezio" id="f5bbed2d-3922-411b-be8b-c3caeb37b340-8A8FF">
<received xmlns="urn:xmpp:carbons:2">
<forwarded xmlns="urn:xmpp:forward:0">
<message xmlns="jabber:client" to="user@example.com/other-client" from="muc.poez.io" type="normal">
<body>Hello</body>
<stanza-id xmlns="urn:xmpp:sid:0" by="user@example.com" id="2019-10-05-79fc69950cfa97e0" />
</message>
</forwarded>
</received>
</message>
How to reproduce
You need a prosody server for this, sorry. You also need to have two clients connected to your account. Let us assume that your account is user@example.com
and your clients are at user@example.com/poezio
and user@example.com/something-else
. Your account needs to be directly connected to your prosody.
-
In the prosody telnet console, enter (remember that the leading
>
is important):>prosody.core_post_stanza(hosts["example.com"], require"util.stanza".message({type="normal",to="user@example.com/poezio",from="muc.poez.io"}):body("Hello"))
Observe that the message is visible in Poezio.
-
Next open the
/xml_tab
in poezio and then execute in the Prosody telnet console:>prosody.core_post_stanza(hosts["example.com"], require"util.stanza".message({type="normal",to="user@example.com/something-else",from="muc.poez.io"}):body("Hello"))
Observe that the message is not shown in Poezio, despite it shows up in the
/xml_tab
. -
Try the same with a different sender:
>prosody.core_post_stanza(hosts["example.com"], require"util.stanza".message({type="normal",to="user@example.com/something-else",from="example.com"}):body("Hello"))
Note that this time the message is visible.