aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0030_service_discovery/identity.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-04-21 16:25:21 +0200
committerfiaxh <git@lightrise.org>2020-04-21 16:25:21 +0200
commit7c4260eed718961874fc0ea665263ea2ce59338b (patch)
tree7d583974ebf797e7e827836176c87735a87c39f6 /xmpp-vala/src/module/xep/0030_service_discovery/identity.vala
parent3a8fef7b7b3c101c4bcb8cd3d7460a009c98a41e (diff)
downloaddino-7c4260eed718961874fc0ea665263ea2ce59338b.tar.gz
dino-7c4260eed718961874fc0ea665263ea2ce59338b.zip
Remove features from service discovery module when detaching module from stream
fixes #179 fixes #812
Diffstat (limited to 'xmpp-vala/src/module/xep/0030_service_discovery/identity.vala')
-rw-r--r--xmpp-vala/src/module/xep/0030_service_discovery/identity.vala12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/xep/0030_service_discovery/identity.vala b/xmpp-vala/src/module/xep/0030_service_discovery/identity.vala
index 43aecfb2..aec2ed24 100644
--- a/xmpp-vala/src/module/xep/0030_service_discovery/identity.vala
+++ b/xmpp-vala/src/module/xep/0030_service_discovery/identity.vala
@@ -17,6 +17,18 @@ public class Identity {
this.type_ = type;
this.name = name;
}
+
+ public static uint hash_func(Identity a) {
+ uint hash = a.category.hash() ^ a.type_.hash();
+ if (a.name != null) {
+ hash ^= a.name.hash();
+ }
+ return hash;
+ }
+
+ public static bool equals_func(Identity a, Identity b) {
+ return a.category == b.category && a.type_ == b.type_ && a.name == b.name;
+ }
}
}