powered by Jive Software

ChatManager wrong MESSAGE_FILTER

Logical bug at MESSAGE_FILTER in org.jivesoftware.smack.chat2.ChatManager class an therefore it is incapable to listen messages with IncomingChatMessageListener and OutgoingChatMessageListener instances.

@see line 74:

private static final StanzaFilter MESSAGE_FILTER = new AndFilter(

MessageTypeFilter.NORMAL_OR_CHAT,

new OrFilter(MessageWithBodiesFilter.INSTANCE), new StanzaExtensionFilter(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE)

);

It should be:

private static final StanzaFilter MESSAGE_FILTER = new AndFilter(

MessageTypeFilter.NORMAL_OR_CHAT,

new OrFilter(MessageWithBodiesFilter.INSTANCE, new StanzaExtensionFilter(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE))

);

Smack version: 4.2.0-rc3-SNAPSHOT (4.2.0-rc2-19-g85fcb55-4.2 2017-01-29)

Thanks for reporting. Fixed with Fix chat2.ChatManager’s message filter · Flowdalic/Smack@bf1e07e · GitHub and uploaded to Maven Snapshots repo. Please report back if it fixes the issue for you.

1 Like

Thanks!