Commit 71663b27 authored by Naveen Vemula's avatar Naveen Vemula

When creating a room using RestAPI plugin, RoomUpdateEvent should be fired...

When creating a room using RestAPI plugin, RoomUpdateEvent should be fired only after the room is fully processed/configured
parent 9f73ae15
......@@ -246,11 +246,6 @@ public class MUCRoomController {
room.setMembersOnly(mucRoomEntity.isMembersOnly());
room.setModerated(mucRoomEntity.isModerated());
// Fire RoomUpdateEvent if cluster is started
if (ClusterManager.isClusteringStarted()) {
CacheFactory.doClusterTask(new RoomUpdatedEvent((LocalMUCRoom) room));
}
// Set broadcast presence roles
if (mucRoomEntity.getBroadcastPresenceRoles() != null) {
room.setRolesToBroadcastPresence(mucRoomEntity.getBroadcastPresenceRoles());
......@@ -277,6 +272,11 @@ public class MUCRoomController {
// Unlock the room, because the default configuration lock the room.
room.unlock(room.getRole());
// Fire RoomUpdateEvent if cluster is started
if (ClusterManager.isClusteringStarted()) {
CacheFactory.doClusterTask(new RoomUpdatedEvent((LocalMUCRoom) room));
}
// Save the room to the DB if the room should be persistant
if (room.isPersistent()) {
room.saveToDB();
......
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