public void joinRoomChat(QBDialog dialog) throws XMPPException, SmackException, QBResponseException { QBGroupChat roomChat = createChatIfNotExist(dialog); if (!roomChat.isJoined()) { DiscussionHistory history = new DiscussionHistory(); history.setMaxStanzas(0); roomChat.join(history); } }
public void leaveDialogs() throws XMPPException, SmackException.NotConnectedException { if (groupDialogsList != null) { for (QBDialog dialog : groupDialogsList) { QBGroupChat roomChat = groupChatManager.getGroupChat(dialog.getRoomJid()); if (roomChat != null && roomChat.isJoined()) { roomChat.leave(); } } } }