public synchronized Long removeModerator(String publicSID) {
try {
log.debug("*..*addModerator publicSID: " + publicSID);
IConnection current = Red5.getConnectionLocal();
//String streamid = current.getClient().getId();
RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID);
if (currentClient == null) {
return -1L;
}
Long room_id = currentClient.getRoom_id();
currentClient.setIsMod(false);
//Put the mod-flag to true for this client
this.clientListManager.updateClientByStreamId(currentClient.getStreamid(), currentClient);
List<RoomClient> currentMods = this.clientListManager.getCurrentModeratorByRoom(room_id);
//Notify all clients of the same scope (room)
Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
if (rcl == null) {