From fdffd58d259f64e0457cd027c719150444b203df Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Wed, 14 Oct 2020 16:21:22 +0200 Subject: [PATCH] Add method to remove registered CAPS listener ServiceDiscoveryManager allows a listener for CAPS changes to be registered. It should also allow to remove a previously registered listener. --- .../jivesoftware/smackx/disco/ServiceDiscoveryManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java index b37209ad4..20714db77 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java @@ -921,6 +921,10 @@ public final class ServiceDiscoveryManager extends Manager { return entityCapabilitiesChangedListeners.add(entityCapabilitiesChangedListener); } + public boolean removeEntityCapabilitiesChangedListener(EntityCapabilitiesChangedListener entityCapabilitiesChangedListener) { + return entityCapabilitiesChangedListeners.remove(entityCapabilitiesChangedListener); + } + private static final int RENEW_ENTITY_CAPS_DELAY_MILLIS = 25; private ScheduledAction renewEntityCapsScheduledAction;