1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Add MamManager.getArchiveAddress()

This commit is contained in:
Florian Schmaus 2018-05-31 18:27:11 +02:00
parent 98a029e9c7
commit 7a2e4140c7

View file

@ -112,6 +112,24 @@ public final class MamManager extends Manager {
serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection);
}
/**
* The the XMPP address of this MAM archive. Note that this method may return {@code null} if this MamManager
* handles the local entity's archive and if the connection has never been authenticated at least once.
*
* @return the XMPP address of this MAM archive or {@code null}.
* @since 4.3.0
*/
public Jid getArchiveAddress() {
if (archiveAddress == null) {
EntityFullJid localJid = connection().getUser();
if (localJid == null) {
return null;
}
return localJid.asBareJid();
}
return archiveAddress;
}
/**
* Query archive with a maximum amount of results.
*