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

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
This commit is contained in:
Florian Schmaus 2013-11-04 20:58:36 +00:00 committed by flow
parent 385cfac9fa
commit 717d39c8fc

View file

@ -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) {