diff --git a/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java b/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java index 258e126ce..f1743896b 100644 --- a/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java +++ b/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java @@ -143,13 +143,14 @@ public class ChatHistory msg.timestamp = System.currentTimeMillis(); } + Entry entry = new Entry(channel, msg); for (Name username : usernames) { // add the message to this user's chat history List history = getList(username); if (history == null) { continue; } - history.add(new Entry(channel, msg)); + history.add(entry); // if the history is big enough, potentially prune it (we always prune when asked for // the history, so this is just to balance memory usage with CPU expense)