1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 15:32:06 +01:00

Fix MamManager.isSupported(): Use archive address

This commit is contained in:
Florian Schmaus 2018-06-06 08:39:44 +02:00
parent 5ae164f670
commit a3cf1ab0ca

View file

@ -51,7 +51,6 @@ import org.jivesoftware.smackx.rsm.packet.RSMSet;
import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm; import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
@ -636,8 +635,9 @@ public final class MamManager extends Manager {
* @see <a href="https://xmpp.org/extensions/xep-0313.html#support">XEP-0313 § 7. Determining support</a> * @see <a href="https://xmpp.org/extensions/xep-0313.html#support">XEP-0313 § 7. Determining support</a>
*/ */
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
BareJid myBareJid = connection().getUser().asBareJid(); // Note that this may return 'null' but SDM's supportsFeature() does the right thing then.
return serviceDiscoveryManager.supportsFeature(myBareJid, MamElements.NAMESPACE); Jid archiveAddress = getArchiveAddress();
return serviceDiscoveryManager.supportsFeature(archiveAddress, MamElements.NAMESPACE);
} }
private static DataForm getNewMamForm() { private static DataForm getNewMamForm() {