diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-27 21:04:44 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-27 21:04:44 +0100 |
commit | 9fbecd81fa66cb210e45be906c0723238f55b649 (patch) | |
tree | 88f4bebf3783a473faf1fc57e091125620a6501d /src/main/java/de/pixart | |
parent | 678344b165760bf174872721428748a608beea96 (diff) |
show pep as available if omemo_all_access has been installed on server
Diffstat (limited to '')
3 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java index c29d507ba..b77bb24fb 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java @@ -63,6 +63,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { public static final String PEP_DEVICE_LIST_NOTIFY = PEP_DEVICE_LIST + "+notify"; public static final String PEP_BUNDLES = PEP_PREFIX + ".bundles"; public static final String PEP_VERIFICATION = PEP_PREFIX + ".verification"; + public static final String PEP_OMEMO_WHITELISTED = PEP_PREFIX + ".whitelisted"; public static final String LOGPREFIX = "AxolotlService"; diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index c461370eb..4a203af43 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -972,7 +972,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat AxolotlService axolotlService = this.mAccount.getAxolotlService(); if (axolotlService != null && axolotlService.isPepBroken()) { this.mServerInfoPep.setText(R.string.server_info_broken); - } else if (features.pepPublishOptions()) { + } else if (features.pepPublishOptions() || features.pepOmemoWhitelisted()) { this.mServerInfoPep.setText(R.string.server_info_available); } else { this.mServerInfoPep.setText(R.string.server_info_partial); diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index b7233b848..acb15e068 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -54,6 +54,7 @@ import de.duenndns.ssl.DomainHostnameVerifier; import de.duenndns.ssl.MemorizingTrustManager; import de.pixart.messenger.Config; import de.pixart.messenger.crypto.XmppDomainVerifier; +import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.crypto.sasl.Anonymous; import de.pixart.messenger.crypto.sasl.DigestMd5; import de.pixart.messenger.crypto.sasl.External; @@ -1738,10 +1739,11 @@ public class XmppConnection implements Runnable { } public boolean pepPublishOptions() { - synchronized (XmppConnection.this.disco) { - ServiceDiscoveryResult info = disco.get(account.getJid().toBareJid()); - return info != null && info.getFeatures().contains(Namespace.PUBSUB_PUBLISH_OPTIONS); - } + return hasDiscoFeature(account.getJid().toBareJid(),Namespace.PUBSUB_PUBLISH_OPTIONS); + } + + public boolean pepOmemoWhitelisted() { + return hasDiscoFeature(account.getJid().toBareJid(), AxolotlService.PEP_OMEMO_WHITELISTED); } public boolean mam() { |