From 7c4260eed718961874fc0ea665263ea2ce59338b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 21 Apr 2020 16:25:21 +0200 Subject: Remove features from service discovery module when detaching module from stream fixes #179 fixes #812 --- .../src/module/xep/0030_service_discovery/identity.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xmpp-vala/src/module/xep/0030_service_discovery/identity.vala') 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; + } } } -- cgit v1.2.3-54-g00ecf