powered by Jive Software

Muc messages without body being filtered out

Hello everybody

I am using Smack 3.1.0 MultiUserChat extension.

I noticed in org.jivesoftware.smackx.muc.MultiUserChat source code that messages without bodies are being ignored :

private void init() {
// Create filters
messageFilter =
new AndFilter(
new FromMatchesFilter(room),
new MessageTypeFilter(Message.Type.groupchat));
messageFilter = new AndFilter(messageFilter, new PacketFilter() {
public boolean accept(Packet packet) {
Message msg = (Message) packet;
return msg.getBody() != null;
}
});

Such messages without body are not filtered out in regular chat.

I was expecting MUC to behave the same way as as regular chat : allowing messages with null bodies.

Is that a bug or a feature ?

PS : The XMPP client I am developping is using messages with packet extensions which content need not be displayed by the client as textual output. I am trying to remove unnecessary body tags from those messages in order to avoid polluting regular XMPP clients output (ie in order for my app to be a clean XMPP citizen).