From a3cf1ab0ca0f5ed4ab5b54fa5345a11a30a47f24 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 6 Jun 2018 08:39:44 +0200 Subject: [PATCH] Fix MamManager.isSupported(): Use archive address --- .../main/java/org/jivesoftware/smackx/mam/MamManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java index 300e78f1a..762bdaa9e 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java @@ -51,7 +51,6 @@ import org.jivesoftware.smackx.rsm.packet.RSMSet; import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.packet.DataForm; -import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; @@ -636,8 +635,9 @@ public final class MamManager extends Manager { * @see XEP-0313 § 7. Determining support */ public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { - BareJid myBareJid = connection().getUser().asBareJid(); - return serviceDiscoveryManager.supportsFeature(myBareJid, MamElements.NAMESPACE); + // Note that this may return 'null' but SDM's supportsFeature() does the right thing™ then. + Jid archiveAddress = getArchiveAddress(); + return serviceDiscoveryManager.supportsFeature(archiveAddress, MamElements.NAMESPACE); } private static DataForm getNewMamForm() {