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
......@@ -245,11 +245,6 @@ public class MUCRoomController {
room.setMaxUsers(mucRoomEntity.getMaxUsers());
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) {
......@@ -276,6 +271,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()) {
......@@ -592,4 +592,4 @@ public class MUCRoomController {
throw new ServiceException("Could not delete affiliation", jid, ExceptionType.NOT_ALLOWED, Response.Status.CONFLICT, e);
}
}
}
\ No newline at end of file
}
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