mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 21:42:07 +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:
parent
385cfac9fa
commit
717d39c8fc
1 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue