public LocalMUCRoom getRoom() { MultiUserChatService mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain); if (mucService == null) { throw new IllegalArgumentException("MUC service not found for subdomain: "+subdomain); } LocalMUCRoom room = (LocalMUCRoom) mucService.getChatRoom(roomName); if (room == null) { throw new IllegalArgumentException("Room not found: " + roomName); } return room; }
@Override public int compare(MultiUserChatService o1, MultiUserChatService o2) { return o1.getServiceName().compareTo(o2.getServiceName()); } }
@Override public void run() { MultiUserChatService mucService = room.getMUCService(); mucService.chatRoomAdded(room); }
public ServiceInfo(MultiUserChatService service) { this.subdomain = service.getServiceName(); this.description = service.getDescription(); this.isHidden = service.isHidden(); rooms = new ArrayList<>(); // Get rooms that have occupants and include them in the reply for (MUCRoom room : service.getChatRooms()) { LocalMUCRoom localRoom = (LocalMUCRoom) room; if (!room.getOccupants().isEmpty()) { rooms.add(new RoomInfo(localRoom, localRoom.getOccupants())); } } }
this.modificationDate = new Date(startTime); this.emptyDate = new Date(startTime); this.canOccupantsChangeSubject = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canOccupantsChangeSubject", false); this.maxUsers = MUCPersistenceManager.getIntProperty(mucService.getServiceName(), "room.maxUsers", 30); this.publicRoom = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.publicRoom", true); this.persistent = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.persistent", false); this.moderated = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.moderated", false); this.membersOnly = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.membersOnly", false); this.canOccupantsInvite = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canOccupantsInvite", false); this.canAnyoneDiscoverJID = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canAnyoneDiscoverJID", true); this.logEnabled = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.logEnabled", true); this.loginRestrictedToNickname = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.loginRestrictedToNickname", false); this.canChangeNickname = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canChangeNickname", true); this.registrationEnabled = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.registrationEnabled", true); roomHistory = new MUCRoomHistory(this, new HistoryStrategy(mucService.getHistoryStrategy())); this.iqOwnerHandler = new IQOwnerHandler(this, packetRouter); this.iqAdminHandler = new IQAdminHandler(this, packetRouter);
MUCRole role = roles.get(group); if (role == null) { if (server.hasChatRoom(group)) { boolean declinedInvitation = false; Element userInfo = null; server.getChatRoom(group).sendInvitationRejection( new JID(info.attributeValue("to")), info.elementTextTrim("reason"),
for ( final MultiUserChatService mucService : XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServices() ) if ( !mucService.isSysadmin( focusUserJid ) ) Log.info( "Adding 'focus' user as a sysadmin to the '{}' MUC service.", mucService.getServiceName() ); mucService.addSysadmin( focusUserJid );
return; if (!mucService.isServiceEnabled()) { note.addAttribute("type", "error"); note.setText("Multi user chat is disabled for specified service."); MUCRoom room; try { room = mucService.getChatRoom(roomname, admin);
final boolean isSysadmin = mucService.isSysadmin(bareJID); final boolean requirePassword = isSysadmin ? mucService.isPasswordRequiredForSysadminsToJoinRoom() : true; if (!isCorrectPassword && requirePassword ) { throw new UnauthorizedException(); affiliation = MUCRole.Affiliation.owner; else if (mucService.isSysadmin(bareJID)) {
@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)); } } } }
affiliation = MUCRole.Affiliation.owner; else if (mucService.isSysadmin(bareJID)) {
@Override public void run() { MultiUserChatService mucService = room.getMUCService(); mucService.chatRoomRemoved(room); }
mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain); if (mucService == null) throw new IllegalArgumentException("MUC service not found for subdomain: " + subdomain); roomHistory = new MUCRoomHistory(this, new HistoryStrategy(mucService.getHistoryStrategy()));
public ServiceInfo(MultiUserChatService service) { this.subdomain = service.getServiceName(); this.description = service.getDescription(); this.isHidden = service.isHidden(); rooms = new ArrayList<>(); // Get rooms that have occupants and include them in the reply for (MUCRoom room : service.getChatRooms()) { LocalMUCRoom localRoom = (LocalMUCRoom) room; if (!room.getOccupants().isEmpty()) { rooms.add(new RoomInfo(localRoom, localRoom.getOccupants())); } } }
private void updateDomainRoom(String roomName, String roomStatus, String description) { Log.debug( "createRoom " + roomName + " " + roomStatus); boolean isBookmarksAvailable = XMPPServer.getInstance().getPluginManager().getPlugin("bookmarks") != null; try { String domainName = JiveGlobals.getProperty("xmpp.domain", XMPPServer.getInstance().getServerInfo().getHostname()); if (XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService("conference").hasChatRoom(roomName) == false) { MUCRoom room = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService("conference").getChatRoom(roomName); if (room == null) { room = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService("conference").getChatRoom(roomName, new JID("admin@"+domainName)); if (room != null) { configureRoom(room, description); if (isBookmarksAvailable) createBookMark(roomName, roomStatus, description); } } } } catch (Exception e) { Log.error("createRoom", e); } }
this.modificationDate = new Date(startTime); this.emptyDate = new Date(startTime); this.canOccupantsChangeSubject = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canOccupantsChangeSubject", false); this.maxUsers = MUCPersistenceManager.getIntProperty(mucService.getServiceName(), "room.maxUsers", 30); this.publicRoom = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.publicRoom", true); this.persistent = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.persistent", false); this.moderated = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.moderated", false); this.membersOnly = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.membersOnly", false); this.canOccupantsInvite = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canOccupantsInvite", false); this.canAnyoneDiscoverJID = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canAnyoneDiscoverJID", true); this.logEnabled = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.logEnabled", false); this.loginRestrictedToNickname = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.loginRestrictedToNickname", false); this.canChangeNickname = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.canChangeNickname", true); this.registrationEnabled = MUCPersistenceManager.getBooleanProperty(mucService.getServiceName(), "room.registrationEnabled", true); roomHistory = new MUCRoomHistory(this, new HistoryStrategy(mucService.getHistoryStrategy())); this.iqOwnerHandler = new IQOwnerHandler(this, packetRouter); this.iqAdminHandler = new IQAdminHandler(this, packetRouter);
return; if (!mucService.isServiceEnabled()) { note.addAttribute("type", "error"); note.setText("Multi user chat is disabled for specified service."); MUCRoom room; try { room = mucService.getChatRoom(roomname, admin);
@Override public void leftCluster(byte[] nodeID) { // Remove all room occupants linked to the defunct node as their sessions are cleaned out earlier Log.debug("Removing orphaned occupants associated with defunct node: " + new String(nodeID, StandardCharsets.UTF_8)); for (MultiUserChatService service : getMultiUserChatServices()) { for (MUCRoom mucRoom : service.getChatRooms()) { for (MUCRole mucRole : mucRoom.getOccupants()) { if (mucRole.getNodeID().equals(nodeID)) { mucRoom.leaveRoom(mucRole); } } } } }
@Override public void run() { MultiUserChatService mucService = room.getMUCService(); mucService.chatRoomRemoved(room); }
mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain); if (mucService == null) throw new IllegalArgumentException("MUC service not found for subdomain: " + subdomain); roomHistory = new MUCRoomHistory(this, new HistoryStrategy(mucService.getHistoryStrategy()));