Commit 8f8592ef authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

1) Modified to accept messages sent by the room itself that are modifying the...

1) Modified to accept messages sent by the room itself that are modifying the room's subject. JM-51 
2) Fixed broadcast bug of messages whose sender is offline. JM-52


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@486 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2bb16451
...@@ -48,11 +48,17 @@ public final class MUCRoomHistory { ...@@ -48,11 +48,17 @@ public final class MUCRoomHistory {
public void addMessage(Message packet) { public void addMessage(Message packet) {
// Don't keep messages whose sender is the room itself (thus address without resource) // Don't keep messages whose sender is the room itself (thus address without resource)
if (packet.getSender().getResourcePrep() == null // unless the message is changing the room's subject
|| packet.getSender().getResourcePrep().length() == 0) { if ((packet.getSender().getResourcePrep() == null
|| packet.getSender().getResourcePrep().length() == 0) &&
packet.getSubject() == null) {
return; return;
} }
Message packetToAdd = (Message) packet.createDeepCopy(); Message packetToAdd = (Message) packet.createDeepCopy();
// Clean the originating session of this message. We will need to deliver this message even
// after the user that sent it has logged off. Otherwise, it won't be delivered since
// messenger expects senders of messages to be authenticated when delivering their messages.
packetToAdd.setOriginatingSession(null);
// TODO Analyze concurrency (on the LinkList) when adding many messages simultaneously // TODO Analyze concurrency (on the LinkList) when adding many messages simultaneously
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment