use of net.java.otr4j.OtrException in project Conversations by siacs.
the class VerifyOTRActivity method abortSmp.
protected boolean abortSmp() {
final Session session = mConversation.getOtrSession();
if (session != null) {
try {
session.abortSmp();
mConversation.smp().status = Conversation.Smp.STATUS_NONE;
mConversation.smp().hint = null;
mConversation.smp().secret = null;
return true;
} catch (OtrException e) {
return false;
}
} else {
return false;
}
}
use of net.java.otr4j.OtrException in project xabber-android by redsolution.
the class OTRManager method onContactUnAvailable.
public void onContactUnAvailable(String account, String user) {
Session session = sessions.get(account, user);
if (session == null) {
return;
}
if (session.getSessionStatus() == SessionStatus.ENCRYPTED) {
try {
LogManager.i(this, "onContactUnAvailable. Refresh session for " + user);
session.refreshSession();
} catch (OtrException e) {
LogManager.exception(this, e);
}
}
}
use of net.java.otr4j.OtrException in project xabber-android by redsolution.
the class OTRManager method refreshSession.
public void refreshSession(String account, String user) throws NetworkException {
LogManager.i(this, "Refreshing session for " + user);
try {
getOrCreateSession(account, user).refreshSession();
} catch (OtrException e) {
throw new NetworkException(R.string.OTR_ERROR, e);
}
LogManager.i(this, "Refreshed session for " + user);
}
use of net.java.otr4j.OtrException in project xabber-android by redsolution.
the class OTRManager method initSmp.
/**
* Initiate request using SM protocol.
*/
public void initSmp(String account, String user, String question, String secret) throws NetworkException {
LogManager.i(this, "initializing smp... " + user);
removeSMRequest(account, user);
addSMProgress(account, user);
try {
getOrCreateSession(account, user).initSmp(question, secret);
} catch (OtrException e) {
throw new NetworkException(R.string.OTR_ERROR, e);
}
}
use of net.java.otr4j.OtrException in project xabber-android by redsolution.
the class OTRManager method startSession.
public void startSession(String account, String user) throws NetworkException {
LogManager.i(this, "Starting session for " + user);
try {
getOrCreateSession(account, user).startSession();
} catch (OtrException e) {
throw new NetworkException(R.string.OTR_ERROR, e);
}
LogManager.i(this, "Started session for " + user);
}
Aggregations