1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Add PubSubManager.getInstanceFor() just like all other Managers

and deprecate PubSubManager.getInstance().
This commit is contained in:
Florian Schmaus 2019-04-16 10:09:01 +02:00
parent 99bf8316f5
commit d97fb126a1
8 changed files with 40 additions and 14 deletions

View file

@ -125,7 +125,7 @@ public class OmemoManagerSetupHelper {
}
public static void cleanUpPubSub(OmemoManager omemoManager) {
PubSubManager pm = PubSubManager.getInstance(omemoManager.getConnection(),omemoManager.getOwnJid());
PubSubManager pm = PubSubManager.getInstanceFor(omemoManager.getConnection(),omemoManager.getOwnJid());
try {
omemoManager.requestDeviceListUpdateFor(omemoManager.getOwnJid());
} catch (SmackException.NotConnectedException | InterruptedException | SmackException.NoResponseException | PubSubException.NotALeafNodeException | XMPPException.XMPPErrorException e) {

View file

@ -42,7 +42,7 @@ public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
if (pubSubService == null) {
throw new TestNotPossibleException("No PubSub service found");
}
pubSubManagerOne = PubSubManager.getInstance(conOne, pubSubService);
pubSubManagerOne = PubSubManager.getInstanceFor(conOne, pubSubService);
if (!pubSubManagerOne.canCreateNodesAndPublishItems()) {
throw new TestNotPossibleException("PubSub service does not allow node creation");
}