use of net.java.otr4j.OtrKeyManagerListener in project Zom-Android by zom.
the class RemoteImService method initOtrChatManager.
private synchronized OtrChatManager initOtrChatManager() {
int otrPolicy = convertPolicy();
if (mOtrChatManager == null) {
try {
OtrAndroidKeyManagerImpl otrKeyManager = OtrAndroidKeyManagerImpl.getInstance(this);
if (otrKeyManager != null) {
mOtrChatManager = OtrChatManager.getInstance(otrPolicy, this, otrKeyManager);
mOtrChatManager.addOtrEngineListener(this);
otrKeyManager.addListener(new OtrKeyManagerListener() {
public void verificationStatusChanged(SessionID session) {
boolean isVerified = mOtrChatManager.getKeyManager().isVerified(session);
String msg = session + ": verification status=" + isVerified;
OtrDebugLogger.log(msg);
}
public void remoteVerifiedUs(SessionID session) {
String msg = session + ": remote verified us";
OtrDebugLogger.log(msg);
showToast(getString(R.string.remote_verified_us), Toast.LENGTH_SHORT);
// if (!isRemoteKeyVerified(session))
// showWarning(session, mContext.getApplicationContext().getString(R.string.remote_verified_us));
}
});
}
} catch (Exception e) {
OtrDebugLogger.log("unable to init OTR manager", e);
}
} else {
mOtrChatManager.setPolicy(otrPolicy);
}
return mOtrChatManager;
}
Aggregations