From baf76d883cd513251445c31680dc9847d6fa3877 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 31 Oct 2015 22:55:04 +0100 Subject: indicate cbe in chat message hint --- .../conversations/crypto/axolotl/AxolotlService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/eu/siacs/conversations/crypto/axolotl') diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index 8cda3c12..2aaadab7 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -778,6 +778,22 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { return newSessions; } + public boolean trustedSessionVerified(final Conversation conversation) { + Set sessions = findSessionsforContact(conversation.getContact()); + sessions.addAll(findOwnSessions()); + boolean verified = false; + for(XmppAxolotlSession session : sessions) { + if (session.getTrust().trusted()) { + if (session.getTrust() == XmppAxolotlSession.Trust.TRUSTED_X509) { + verified = true; + } else { + return false; + } + } + } + return verified; + } + public boolean hasPendingKeyFetches(Account account, Contact contact) { AxolotlAddress ownAddress = new AxolotlAddress(account.getJid().toBareJid().toString(), 0); AxolotlAddress foreignAddress = new AxolotlAddress(contact.getJid().toBareJid().toString(), 0); -- cgit v1.2.3