src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java
/**
     * Opens a chat window for the chat room.
     *
     * @param room the chat room.
     */
Opens a chat window for the chat room.
@param room the chat room.
Opens a chat window for the chat room . @param room the chat room .
public void openChatRoom(ChatRoomWrapper room)
    {
        if (room.getChatRoom() == null)
        {
            room = createChatRoom(
                room.getChatRoomName(),
                room.getParentProvider().getProtocolProvider(),
                new ArrayList<String>(),"", false, false, true);
            if (room.getChatRoom().isJoined())
                room.getChatRoom().leave();
        }
        if(!room.getChatRoom().isJoined())
        {
            String savedNick =
                ConfigurationUtils.getChatRoomProperty(room
                    .getParentProvider().getProtocolProvider(), room
                    .getChatRoomID(), "userNickName");
            String subject = null;
            if (savedNick == null)
            {
                String[] joinOptions = ChatRoomJoinOptionsDialog.getJoinOptions(
                    room.getParentProvider().getProtocolProvider(),
                    room.getChatRoomID(),
                    MUCActivator.getGlobalDisplayDetailsService()
                        .getDisplayName(
                            room.getParentProvider().getProtocolProvider()));
                savedNick = joinOptions[0];
                subject = joinOptions[1];
            }
            if (savedNick != null)
            {
                joinChatRoom(room, savedNick, null,
                        subject);
            }
            else
                return;
        }
        MUCActivator.getUIService().openChatRoomWindow(room);
    }
public void openChatRoom ( ChatRoomWrapper room ) { if ( room . getChatRoom ( ) == null ) { room = createChatRoom ( room . getChatRoomName ( ) , room . getParentProvider ( ) . getProtocolProvider ( ) , new ArrayList < String > ( ) , "" , false , false , true ) ; if ( room . getChatRoom ( ) . isJoined ( ) ) room . getChatRoom ( ) . leave ( ) ; } if ( ! room . getChatRoom ( ) . isJoined ( ) ) { String savedNick = ConfigurationUtils . getChatRoomProperty ( room . getParentProvider ( ) . getProtocolProvider ( ) , room . getChatRoomID ( ) , "userNickName" ) ; String subject = null ; if ( savedNick == null ) { String [ ] joinOptions = ChatRoomJoinOptionsDialog . getJoinOptions ( room . getParentProvider ( ) . getProtocolProvider ( ) , room . getChatRoomID ( ) , MUCActivator . getGlobalDisplayDetailsService ( ) . getDisplayName ( room . getParentProvider ( ) . getProtocolProvider ( ) ) ) ; savedNick = joinOptions [ 0 ] ; subject = joinOptions [ 1 ] ; } if ( savedNick != null ) { joinChatRoom ( room , savedNick , null , subject ) ; } else return ; } MUCActivator . getUIService ( ) . openChatRoomWindow ( room ) ; }
Opens a chat window for the chat room.
Opens a chat window for the chat room .
// leave the chatroom because getChatRoom().isJoined() returns true // otherwise