Пример #1
0
 @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) {
   }
 }
Пример #2
0
 @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());
   }
 }