public Chat createChat ( EntityJid userJID , String thread , ChatMessageListener listener ) { if ( thread == null ) { thread = nextID ( ) ; } Chat chat = threadChats . get ( thread ) ; if ( chat != null ) { throw new IllegalArgumentException ( "ThreadID is already used" ) ; } chat = createChat ( userJID , thread , true ) ; chat . addMessageListener ( listener ) ; return chat ; }
Creates a new chat using the specified thread ID then returns it .