From 75b49260252d318abafeb1b7bc05eed8ad8dadc4 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 1 Dec 2017 18:54:39 +0100 Subject: [PATCH] fixed publish-options migration --- .../conversations/crypto/axolotl/AxolotlService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 79b9625b6..4acd46702 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"); }