1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 16:22:06 +01:00

Make SDM a field in SpoilerManager

This commit is contained in:
Florian Schmaus 2018-02-22 09:02:28 +01:00
parent ce19ea4114
commit 81f599425a

View file

@ -29,6 +29,8 @@ public final class SpoilerManager extends Manager {
private static final Map<XMPPConnection, SpoilerManager> INSTANCES = new WeakHashMap<>(); private static final Map<XMPPConnection, SpoilerManager> INSTANCES = new WeakHashMap<>();
private final ServiceDiscoveryManager serviceDiscoveryManager;
/** /**
* Create a new SpoilerManager and add Spoiler to disco features. * Create a new SpoilerManager and add Spoiler to disco features.
* *
@ -36,20 +38,21 @@ public final class SpoilerManager extends Manager {
*/ */
private SpoilerManager(XMPPConnection connection) { private SpoilerManager(XMPPConnection connection) {
super(connection); super(connection);
serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection);
} }
/** /**
* Begin announcing support for Spoiler messages. * Begin announcing support for Spoiler messages.
*/ */
public void startAnnounceSupport() { public void startAnnounceSupport() {
ServiceDiscoveryManager.getInstanceFor(connection()).addFeature(NAMESPACE_0); serviceDiscoveryManager.addFeature(NAMESPACE_0);
} }
/** /**
* End announcing support for Spoiler messages. * End announcing support for Spoiler messages.
*/ */
public void stopAnnounceSupport() { public void stopAnnounceSupport() {
ServiceDiscoveryManager.getInstanceFor(connection()).removeFeature(NAMESPACE_0); serviceDiscoveryManager.removeFeature(NAMESPACE_0);
} }
/** /**