@Override public void verify(SessionID id, String fingerprint, boolean approved) { Log.d( Config.LOGTAG, "OtrService.verify(" + id.toString() + "," + fingerprint + "," + String.valueOf(approved) + ")"); try { final Jid jid = Jid.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account, jid); if (conversation != null) { if (approved) { conversation.getContact().addOtrFingerprint(fingerprint); } conversation.smp().hint = null; conversation.smp().status = Conversation.Smp.STATUS_VERIFIED; mXmppConnectionService.updateConversationUi(); mXmppConnectionService.syncRosterToDisk(conversation.getAccount()); } } catch (final InvalidJidException ignored) { } }
@Override public void askForSecret(SessionID id, InstanceTag instanceTag, String question) { try { final Jid jid = Jid.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account, jid); if (conversation != null) { conversation.smp().hint = question; conversation.smp().status = Conversation.Smp.STATUS_CONTACT_REQUESTED; mXmppConnectionService.updateConversationUi(); } } catch (InvalidJidException e) { Log.d( Config.LOGTAG, account.getJid().toBareJid() + ": smp in invalid session " + id.toString()); } }