show pep as available if omemo_all_access has been installed on server

This commit is contained in:
Daniel Gultsch 2017-12-18 13:47:53 +01:00
parent c5ee541906
commit 127557df56
3 changed files with 8 additions and 5 deletions

View File

@ -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";

View File

@ -913,7 +913,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);

View File

@ -53,6 +53,7 @@ import de.duenndns.ssl.DomainHostnameVerifier;
import de.duenndns.ssl.MemorizingTrustManager;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.crypto.XmppDomainVerifier;
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
import eu.siacs.conversations.crypto.sasl.Anonymous;
import eu.siacs.conversations.crypto.sasl.DigestMd5;
import eu.siacs.conversations.crypto.sasl.External;
@ -1708,10 +1709,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() {