Software /
code /
prosody
Comparison
core/moduleapi.lua @ 8533:66cdf5c7af85
moduleapi: Remove unused and undocumented :has_feature and :has_identity
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 23 Feb 2018 17:11:59 +0100 |
parent | 8487:91f6815de26a |
child | 8993:bd9b67f742c9 |
comparison
equal
deleted
inserted
replaced
8532:17c754b81234 | 8533:66cdf5c7af85 |
---|---|
68 function api:add_identity(category, identity_type, name) | 68 function api:add_identity(category, identity_type, name) |
69 self:add_item("identity", {category = category, type = identity_type, name = name}); | 69 self:add_item("identity", {category = category, type = identity_type, name = name}); |
70 end | 70 end |
71 function api:add_extension(data) | 71 function api:add_extension(data) |
72 self:add_item("extension", data); | 72 self:add_item("extension", data); |
73 end | |
74 function api:has_feature(xmlns) | |
75 for _, feature in ipairs(self:get_host_items("feature")) do | |
76 if feature == xmlns then return true; end | |
77 end | |
78 return false; | |
79 end | |
80 function api:has_identity(category, identity_type, name) | |
81 for _, id in ipairs(self:get_host_items("identity")) do | |
82 if id.category == category and id.type == identity_type and id.name == name then | |
83 return true; | |
84 end | |
85 end | |
86 return false; | |
87 end | 73 end |
88 | 74 |
89 function api:fire_event(...) | 75 function api:fire_event(...) |
90 return (hosts[self.host] or prosody).events.fire_event(...); | 76 return (hosts[self.host] or prosody).events.fire_event(...); |
91 end | 77 end |