@Override public void run() { rooms = new ArrayList<>(); // Get all services that have local occupants and include them in the reply for (MultiUserChatService mucService : XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServices()) { // Get rooms that have local occupants and include them in the reply for (MUCRoom room : mucService.getChatRooms()) { LocalMUCRoom localRoom = (LocalMUCRoom) room; Collection<MUCRole> localOccupants = new ArrayList<>(); for (MUCRole occupant : room.getOccupants()) { if (occupant.isLocal()) { localOccupants.add(occupant); } } if (!localOccupants.isEmpty()) { rooms.add(new RoomInfo(localRoom, localOccupants)); } } } }
if (localMUCRoom != null) { MUCRole occupant = localMUCRoom.getOccupantByFullJID(userjid); if (occupant != null && !occupant.isLocal()) { return new RemoteMUCUser(userjid, localMUCRoom);
public void occupantUpdated(UpdateOccupant update) { List <MUCRole> occupants = occupantsByNickname.get(update.getNickname().toLowerCase()); if (occupants == null || occupants.size() == 0) { Log.debug("LocalMUCRoom: Failed to update information of room occupant. Occupant nickname: " + update.getNickname()); } else { for (MUCRole occupant : occupants) { if (!occupant.isLocal()) { occupant.setPresence(update.getPresence()); try { occupant.setRole(update.getRole()); occupant.setAffiliation(update.getAffiliation()); } catch (NotAllowedException e) { // Ignore. Should never happen with remote roles } } else { Log.error(MessageFormat.format("Ignoring update of local occupant with info from a remote occupant. " + "Occupant nickname: {0} new role: {1} new affiliation: {2}", update.getNickname(), update.getRole(), update.getAffiliation())); } } } }
if (occupant.isLocal()) { occupant.send(event.getPresence().createCopy());
if (leaveRole.isLocal()) { removedRoles.add(leaveRole);
if (role.isLocal()) { role.setAffiliation(newAffiliation); role.setRole(newRole);
if (occupant.isLocal() && !occupant.isVoiceOnly()) { occupant.send(message);
@Override public void leaveRoom(MUCRole leaveRole) { if (leaveRole.isLocal()) {
if (!occupant.isLocal()) { continue;
if (role.isLocal()) {
@Override public void run() { rooms = new ArrayList<>(); // Get all services that have local occupants and include them in the reply for (MultiUserChatService mucService : XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServices()) { // Get rooms that have local occupants and include them in the reply for (MUCRoom room : mucService.getChatRooms()) { LocalMUCRoom localRoom = (LocalMUCRoom) room; Collection<MUCRole> localOccupants = new ArrayList<>(); for (MUCRole occupant : room.getOccupants()) { if (occupant.isLocal()) { localOccupants.add(occupant); } } if (!localOccupants.isEmpty()) { rooms.add(new RoomInfo(localRoom, localOccupants)); } } } }
if (localMUCRoom != null) { MUCRole occupant = localMUCRoom.getOccupantByFullJID(userjid); if (occupant != null && !occupant.isLocal()) { return new RemoteMUCUser(userjid, localMUCRoom);
public void occupantUpdated(UpdateOccupant update) { List <MUCRole> occupants = occupantsByNickname.get(update.getNickname().toLowerCase()); if (occupants == null || occupants.size() == 0) { Log.debug("LocalMUCRoom: Failed to update information of room occupant. Occupant nickname: " + update.getNickname()); } else { for (MUCRole occupant : occupants) { if (!occupant.isLocal()) { occupant.setPresence(update.getPresence()); try { occupant.setRole(update.getRole()); occupant.setAffiliation(update.getAffiliation()); } catch (NotAllowedException e) { // Ignore. Should never happen with remote roles } } else { Log.error(MessageFormat.format("Ignoring update of local occupant with info from a remote occupant. " + "Occupant nickname: {0} new role: {1} new affiliation: {2}", update.getNickname(), update.getRole(), update.getAffiliation())); } } } }
if (occupant.isLocal()) { occupant.send(event.getPresence().createCopy());
if (leaveRole.isLocal()) { removedRoles.add(leaveRole);
if (occupant.isLocal() && !occupant.isVoiceOnly()) { occupant.send(message);
if (role.isLocal()) { role.setAffiliation(newAffiliation); role.setRole(newRole);
@Override public void leaveRoom(MUCRole leaveRole) { if (leaveRole.isLocal()) {
if (!occupant.isLocal()) { continue;
if (role.isLocal()) {