powered by Jive Software

Group Chat History contains one message to many


#1

When specifying “Show a Specific Number of Messages” for Group Chat History Settings, the user get one message to many. For example, if 10 is specified. the user get the last eleven messages in the room.

A glance at the code showed that the bug is easily fixed:

--- a/src/java/org/jivesoftware/openfire/muc/HistoryStrategy.java
+++ b/src/java/org/jivesoftware/openfire/muc/HistoryStrategy.java
@@ -197,7 +197,7 @@ public class HistoryStrategy {
                 // message because we want to preserve the room subject if
                 // possible.
                 Iterator<Message> historyIter = history.iterator();
-                while (historyIter.hasNext() && history.size() > strategyMaxNumber) {
+                while (historyIter.hasNext() && history.size() >= strategyMaxNumber) {
                     if (historyIter.next() != roomSubject) {
                         historyIter.remove();
                     }

#2

If you are familiar with GitHub, you can provide a pull request for this at https://github.com/igniterealtime/Openfire


#3

Already did it. But you have seen this too.