From e159fd2492c28c1ef4ab64828ca0e8c2de877b41 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 3 Jul 2020 21:14:39 +0200 Subject: Only query entity caps when we need them --- .../module/xep/0030_service_discovery/flag.vala | 29 ---------------------- 1 file changed, 29 deletions(-) (limited to 'xmpp-vala/src/module/xep/0030_service_discovery/flag.vala') diff --git a/xmpp-vala/src/module/xep/0030_service_discovery/flag.vala b/xmpp-vala/src/module/xep/0030_service_discovery/flag.vala index 7716ceff..ab311727 100644 --- a/xmpp-vala/src/module/xep/0030_service_discovery/flag.vala +++ b/xmpp-vala/src/module/xep/0030_service_discovery/flag.vala @@ -5,8 +5,6 @@ namespace Xmpp.Xep.ServiceDiscovery { public class Flag : XmppStreamFlag { public static FlagIdentity IDENTITY = new FlagIdentity(NS_URI, "service_discovery"); - public HashMap?> entity_features = new HashMap?>(Jid.hash_func, Jid.equals_func); - private HashMap?> entity_identities = new HashMap?>(Jid.hash_func, Jid.equals_func); private HashMap?> entity_items = new HashMap?>(Jid.hash_func, Jid.equals_func); private Gee.Set own_features_ = new HashSet(); @@ -23,33 +21,6 @@ public class Flag : XmppStreamFlag { owned get { return own_identities_.read_only_view; } } - public Gee.Set? get_entity_identities(Jid jid) { - return entity_identities.has_key(jid) ? entity_identities[jid].read_only_view : null; // TODO isn’t this default for hashmap - } - - public bool? has_entity_identity(Jid jid, string category, string type) { - if (!entity_identities.has_key(jid)) return null; - if (entity_identities[jid] == null) return false; - foreach (Identity identity in entity_identities[jid]) { - if (identity.category == category && identity.type_ == type) return true; - } - return false; - } - - public bool? has_entity_feature(Jid jid, string feature) { - if (!entity_features.has_key(jid)) return null; - if (entity_features[jid] == null) return false; - return entity_features[jid].contains(feature); - } - - public void set_entity_identities(Jid jid, Gee.Set? identities) { - entity_identities[jid] = identities; - } - - public void set_entity_features(Jid jid, Gee.List? features) { - entity_features[jid] = features; - } - public void set_entity_items(Jid jid, Gee.List? features) { entity_items[jid] = features; } -- cgit v1.3