use of org.awesomeapp.messenger.model.ChatGroup in project Zom-Android by zom.
the class ChatSessionAdapter method initOtrChatSession.
private void initOtrChatSession(ImEntity participant) {
try {
if (mConnection != null) {
mDataHandler = new OtrDataHandler(mChatSession);
mDataHandler.setDataListener(mDataHandlerListener);
OtrChatManager cm = service.getOtrChatManager();
cm.addOtrEngineListener(mListenerAdapter);
mChatSession.setMessageListener(new OtrChatListener(cm, mListenerAdapter));
if (participant instanceof Contact) {
String key = participant.getAddress().getAddress();
if (!mOtrChatSessions.containsKey(key)) {
OtrChatSessionAdapter adapter = new OtrChatSessionAdapter(mConnection.getLoginUser().getAddress().getAddress(), participant, cm);
mOtrChatSessions.put(key, adapter);
}
} else if (participant instanceof ChatGroup) {
}
mDataHandler.setChatId(getId());
}
} catch (NullPointerException npe) {
Log.e(ImApp.LOG_TAG, "error init OTR session", npe);
}
}
use of org.awesomeapp.messenger.model.ChatGroup in project Zom-Android by zom.
the class ChatSessionAdapter method setGroupChatSubject.
@Override
public void setGroupChatSubject(String subject) throws RemoteException {
try {
if (isGroupChatSession()) {
ChatGroup group = (ChatGroup) mChatSession.getParticipant();
getGroupManager().setGroupSubject(group, subject);
// update the database
ContentValues values1 = new ContentValues(1);
values1.put(Imps.Contacts.NICKNAME, subject);
ContentValues values = values1;
Uri uriContact = ContentUris.withAppendedId(Imps.Contacts.CONTENT_URI, mContactId);
mContentResolver.update(uriContact, values, null, null);
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations