use of org.awesomeapp.messenger.model.ChatGroupManager in project Zom-Android by zom.
the class ChatSessionManagerAdapter method createMultiUserChatSession.
public IChatSession createMultiUserChatSession(String roomAddress, String subject, String nickname, boolean isNewChat) {
ChatGroupManager groupMan = mConnection.getAdaptee().getChatGroupManager();
try {
if (roomAddress.endsWith("@")) {
String confServer = groupMan.getDefaultGroupChatService();
if (confServer != null)
roomAddress += confServer;
}
// TODO hard coding XMPP for now
Address address = new XmppAddress(roomAddress);
groupMan.createChatGroupAsync(roomAddress, subject, nickname);
ChatGroup chatGroup = groupMan.getChatGroup(address);
if (chatGroup != null && mConnection.getState() == ImConnection.LOGGED_IN) {
ChatSession session = getChatSessionManager().createChatSession(chatGroup, isNewChat);
ChatSessionAdapter adapter = getChatSessionAdapter(session, isNewChat);
groupMan.loadMembers(chatGroup);
return adapter;
} else {
return null;
}
} catch (Exception e) {
Log.e(ImApp.LOG_TAG, "unable to join group chat" + e.getMessage());
return null;
}
}
use of org.awesomeapp.messenger.model.ChatGroupManager in project Zom-Android by zom.
the class ChatSessionManagerAdapter method getChatGroupManager.
public ChatGroupManager getChatGroupManager() {
if ((mConnection.getAdaptee().getCapability() & ImConnection.CAPABILITY_GROUP_CHAT) != 0) {
ChatGroupManager groupManager = mConnection.getAdaptee().getChatGroupManager();
groupManager.addGroupListener(new ChatGroupListenerAdapter());
return groupManager;
} else
return null;
}
Aggregations