Hi,
I’m trying to implement the MucSub (MucSub: Multi-User Chat Subscriptions | ejabberd Docs) for MUC but I’m facing a strange problem.
I correctly subscribe to service and I can query for every info, but when I send a message it does not arrives to the Smack client.
I added a custom stanza listener, just to log everything
xmppConnection.addAsyncStanzaListener(StanzaListener { packet ->
// prints packet.toXML()
}, AndFilter(StanzaTypeFilter.MESSAGE))
But nothing is logged for MUC. Instead, every single-chat message is logged.
As defined in MucSub, if I join the MUC the messages arrives in the MessageListener.
Using a different client, I can see in the log that the message arrives, formatted as defined in specs:
<message from="coven@muc.shakespeare.example"
to="hag66@shakespeare.example/pda">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="urn:xmpp:mucsub:nodes:messages">
<item id="18277869892147515942">
<message from="coven@muc.shakespeare.example/secondwitch"
to="hag66@shakespeare.example/pda"
type="groupchat"
xmlns="jabber:client">
<archived xmlns="urn:xmpp:mam:tmp"
by="muc.shakespeare.example"
id="1467896732929849" />
<stanza-id xmlns="urn:xmpp:sid:0"
by="muc.shakespeare.example"
id="1467896732929849" />
<body>Hello from the MUC room !</body>
</message>
</item>
</items>
</event>
</message>
So, my question is: what’s the right way to intercept this king of stanza?
Does already exists an implementation for MucSub in Smack?
Thanks!