Add MamManager.getArchiveAddress()

This commit is contained in:
Florian Schmaus 2018-05-31 18:27:11 +02:00
parent 98a029e9c7
commit 7a2e4140c7
1 changed files with 18 additions and 0 deletions

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.
*