use of net.java.otr4j.session.SessionImpl in project xabber-android by redsolution.
the class OTRManager method transformReceivingIfSessionExist.
public String transformReceivingIfSessionExist(AccountJid account, UserJid user, String content) throws OtrException {
LogManager.i(this, "transform incoming message... " + content, "transform incoming message... ***");
Session session = getSession(account.toString(), user.toString());
SecurityLevel securityLevel = OTRManager.getInstance().getSecurityLevel(account, user);
if (session != null && (securityLevel == SecurityLevel.encrypted || securityLevel == SecurityLevel.verified)) {
try {
String s = ((SessionImpl) session).transformReceivingWithoutInject(content);
LogManager.i(this, "transformed incoming message: " + s + " session status: " + session.getSessionStatus(), "transformed incoming message: " + "***" + " session status: " + session.getSessionStatus());
return s;
} catch (UnsupportedOperationException e) {
throw new OtrException(e);
}
} else {
return content;
}
}
Aggregations