Details
Description
The offline message store will save every non-null Message object that it receives. This could include messages that do not have a body. Typical examples of these could be chat-state notification messages.
These messages should not be persisted in the offline message store, but ignored instead.
This should fix the problem:
Index: src/java/org/jivesoftware/openfire/OfflineMessageStore.java =================================================================== --- src/java/org/jivesoftware/openfire/OfflineMessageStore.java (revision 10694) +++ src/java/org/jivesoftware/openfire/OfflineMessageStore.java (working copy) @@ -107,6 +107,10 @@ if (message == null) { return; } + if (message.getBody() == null || message.getBody().length() == 0) { + // ignore empty bodied message (typically chat-state notifications). + return; + } JID recipient = message.getTo(); String username = recipient.getNode(); // If the username is null (such as when an anonymous user), don't store.Index: src/java/org/jivesoftware/openfire/OfflineMessageStore.java =================================================================== --- src/java/org/jivesoftware/openfire/OfflineMessageStore.java (revision 10694) +++ src/java/org/jivesoftware/openfire/OfflineMessageStore.java (working copy) @@ -107,6 +107,10 @@ if (message == null) { return; } + if (message.getBody() == null || message.getBody().length() == 0) { + // ignore empty bodied message (typically chat-state notifications). + return; + } JID recipient = message.getTo(); String username = recipient.getNode(); // If the username is null (such as when an anonymous user), don't store.