From 717d39c8fc0eb8fccd17e65a44b8b8cc3eddebf6 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 4 Nov 2013 20:58:36 +0000 Subject: [PATCH] Fix caps support (SMACK-361, SMACK-459). SMACK-459 splitted the SDM identities over two member variables which are joined by getIdentities(), therefore this method must be used to calculated the hash for entity caps. Also recalculate the hash if an identity is added/remvoed/changed. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13801 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smackx/ServiceDiscoveryManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java index a42e5e1bf..cd1d705e3 100644 --- a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java +++ b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java @@ -133,6 +133,7 @@ public class ServiceDiscoveryManager { */ public void setIdentityName(String name) { identity.setName(name); + renewEntityCapsVersion(); } /** @@ -157,6 +158,7 @@ public class ServiceDiscoveryManager { */ public void setIdentityType(String type) { identity.setType(type); + renewEntityCapsVersion(); } /** @@ -166,6 +168,7 @@ public class ServiceDiscoveryManager { */ public void addIdentity(DiscoverInfo.Identity identity) { identities.add(identity); + renewEntityCapsVersion(); } /** @@ -178,6 +181,7 @@ public class ServiceDiscoveryManager { public boolean removeIdentity(DiscoverInfo.Identity identity) { if (identity.equals(this.identity)) return false; identities.remove(identity); + renewEntityCapsVersion(); return true; } @@ -318,7 +322,7 @@ public class ServiceDiscoveryManager { */ public void addDiscoverInfoTo(DiscoverInfo response) { // First add the identities of the connection - response.addIdentities(identities); + response.addIdentities(getIdentities()); // Add the registered features to the response synchronized (features) {