aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java34
1 files changed, 21 insertions, 13 deletions
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 d8287aff..e490ac64 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -9,6 +9,7 @@ import org.whispersystems.libaxolotl.state.PreKeyRecord;
import org.whispersystems.libaxolotl.state.SignedPreKeyRecord;
import java.security.cert.X509Certificate;
+import java.util.List;
import java.util.Set;
import eu.siacs.conversations.entities.Account;
@@ -30,6 +31,8 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded {
String PEP_BUNDLES = PEP_PREFIX + ".bundles";
String PEP_VERIFICATION = PEP_PREFIX + ".verification";
+ int NUM_KEYS_TO_PUBLISH = 100;
+
enum FetchStatus {
PENDING,
SUCCESS,
@@ -38,15 +41,10 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded {
ERROR
}
- boolean fetchMapHasErrors(Contact contact);
-
String getOwnFingerprint();
Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust);
- Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, Contact contact);
-
- long getNumTrustedKeys(Contact contact);
Set<String> getFingerprintsForOwnSessions();
@@ -77,8 +75,6 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded {
void publishBundlesIfNeeded(boolean announce, boolean wipe);
- boolean isContactAxolotlCapable(Contact contact);
-
XmppAxolotlSession.Trust getFingerprintTrust(String fingerprint);
X509Certificate getFingerprintCertificate(String fingerprint);
@@ -87,24 +83,36 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded {
Set<AxolotlAddress> findDevicesWithoutSession(Conversation conversation);
- Set<AxolotlAddress> findDevicesWithoutSession(Jid contactJid);
-
boolean createSessionsIfNeeded(Conversation conversation);
boolean trustedSessionVerified(Conversation conversation);
- boolean hasPendingKeyFetches(Account account, Contact contact);
-
@Nullable
XmppAxolotlMessage encrypt(Message message);
void preparePayloadMessage(Message message, boolean delay);
- void prepareKeyTransportMessage(Contact contact, OnMessageCreatedCallback onMessageCreatedCallback);
-
XmppAxolotlMessage fetchAxolotlMessageFromCache(Message message);
XmppAxolotlMessage.XmppAxolotlPlaintextMessage processReceivingPayloadMessage(XmppAxolotlMessage message);
XmppAxolotlMessage.XmppAxolotlKeyTransportMessage processReceivingKeyTransportMessage(XmppAxolotlMessage message);
+
+ boolean fetchMapHasErrors(List<Jid> jids);
+
+ Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, Jid jid);
+
+ Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, List<Jid> jids);
+
+ long getNumTrustedKeys(Jid jid);
+
+ boolean anyTargetHasNoTrustedKeys(List<Jid> jids);
+
+ boolean isConversationAxolotlCapable(Conversation conversation);
+
+ List<Jid> getCryptoTargets(Conversation conversation);
+
+ boolean hasPendingKeyFetches(Account account, List<Jid> jids);
+
+ void prepareKeyTransportMessage(Conversation conversation, OnMessageCreatedCallback onMessageCreatedCallback);
}