From 69e81b748ed95a1b4422c44141a39968691475d9 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 26 May 2022 15:41:40 +0200 Subject: [PATCH] [disco] Only perform entity capabilities work if there are any listeners --- .../jivesoftware/smackx/disco/ServiceDiscoveryManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 fa60edc92..9fb69ee3c 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 @@ -1,6 +1,6 @@ /** * - * Copyright 2003-2007 Jive Software, 2018-2020 Florian Schmaus. + * Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -933,6 +933,10 @@ public final class ServiceDiscoveryManager extends Manager { * Notify the {@link EntityCapabilitiesChangedListener} about changed capabilities. */ private synchronized void renewEntityCapsVersion() { + if (entityCapabilitiesChangedListeners.isEmpty()) { + return; + } + renewEntityCapsRequested++; if (renewEntityCapsScheduledAction != null) { boolean canceled = renewEntityCapsScheduledAction.cancel();