use of org.awesomeapp.messenger.crypto.otr.OtrDataHandler 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);
}
}
Aggregations