aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2017-12-01 18:54:39 +0100
committerDaniel Gultsch <daniel@gultsch.de>2017-12-01 18:54:39 +0100
commit75b49260252d318abafeb1b7bc05eed8ad8dadc4 (patch)
tree6a35609c6b31fce00e490a639f498a20e3e17c9b
parent23e9c73c94ecfb840b2944b6e9834851794daf13 (diff)
fixed publish-options migration
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java10
1 files changed, 9 insertions, 1 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 79b9625..4acd467 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -604,7 +604,15 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
Log.d(Config.LOGTAG, getLogprefix(account) + "publishBundlesIfNeeded called, but PEP is broken. Ignoring... ");
return;
}
- this.changeAccessMode.set(account.isOptionSet(Account.OPTION_REQUIRES_ACCESS_MODE_CHANGE) && account.getXmppConnection().getFeatures().pepPublishOptions());
+
+ if (account.getXmppConnection().getFeatures().pepPublishOptions()) {
+ this.changeAccessMode.set(account.isOptionSet(Account.OPTION_REQUIRES_ACCESS_MODE_CHANGE));
+ } else {
+ if (account.setOption(Account.OPTION_REQUIRES_ACCESS_MODE_CHANGE,true)) {
+ Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": server doesn’t support publish-options. setting for later access mode change");
+ mXmppConnectionService.databaseBackend.updateAccount(account);
+ }
+ }
if (this.changeAccessMode.get()) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": server gained publish-options capabilities. changing access model");
}