groupChat = new MultiUserChat(this.connection, chat.getName());
try {
groupChat.join(this.groupChatNick, chat.getPassword());
} catch (XMPPException e) {
LOGGER.warning("Cannot join group chat '" + chat + "'. Exception:\n" + ExceptionHelper.dump(e));
throw new IMException(e);
} catch (SmackException e) {
LOGGER.warning("Cannot join group chat '" + chat + "'. Exception:\n" + ExceptionHelper.dump(e));
throw new IMException(e);
}
// get rid of old messages:
while (groupChat.pollMessage() != null) {
}