Commit 44d2153b authored by Tom Evans's avatar Tom Evans Committed by tevans

OF-661: Propagate MUC room subject/topic updates across cluster

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13616 b35dd754-fafc-0310-a699-88a17e54d16e
parent 79fe54a3
......@@ -64,6 +64,7 @@ import org.jivesoftware.openfire.muc.cluster.ChangeNickname;
import org.jivesoftware.openfire.muc.cluster.DestroyRoomRequest;
import org.jivesoftware.openfire.muc.cluster.OccupantAddedEvent;
import org.jivesoftware.openfire.muc.cluster.OccupantLeftEvent;
import org.jivesoftware.openfire.muc.cluster.RoomUpdatedEvent;
import org.jivesoftware.openfire.muc.cluster.UpdateOccupant;
import org.jivesoftware.openfire.muc.cluster.UpdateOccupantRequest;
import org.jivesoftware.openfire.muc.cluster.UpdatePresence;
......@@ -1777,6 +1778,11 @@ public class LocalMUCRoom implements MUCRoom {
// Fire event signifying that the room's subject has changed.
MUCEventDispatcher.roomSubjectChanged(getJID(), role.getUserAddress(), subject);
if (!"local-only".equals(packet.getID())) {
// Let other cluster nodes that the room has been updated
CacheFactory.doClusterTask(new RoomUpdatedEvent(this));
}
}
else {
throw new ForbiddenException();
......
......@@ -260,13 +260,7 @@
}
dataForm.addField(field);
// Create an IQ packet and set the dataform as the main fragment
IQ iq = new IQ(IQ.Type.set);
Element element = iq.setChildElement("query", "http://jabber.org/protocol/muc#owner");
element.add(dataForm.asXMLElement());
// Send the IQ packet that will modify the room's configuration
room.getIQOwnerHandler().handleIQ(iq, room.getRole());
// update subject before sending IQ (to include subject with cluster update)
if (roomSubject != null) {
// Change the subject of the room by sending a new message
Message message = new Message();
......@@ -274,9 +268,17 @@
message.setSubject(roomSubject);
message.setFrom(room.getRole().getRoleAddress());
message.setTo(room.getRole().getRoleAddress());
message.setID("local-only");
room.changeSubject(message, room.getRole());
}
// Create an IQ packet and set the dataform as the main fragment
IQ iq = new IQ(IQ.Type.set);
Element element = iq.setChildElement("query", "http://jabber.org/protocol/muc#owner");
element.add(dataForm.asXMLElement());
// Send the IQ packet that will modify the room's configuration
room.getIQOwnerHandler().handleIQ(iq, room.getRole());
// Changes good, so redirect
String params;
if (create) {
......
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