Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1706:0e6ba1678d8e
modulemanager: add_feature and add_identity APIs updated to use only the add_item API
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 18 Aug 2009 12:51:14 +0500 |
parent | 1698:af89f646200f |
child | 1707:c55aa091f42a |
comparison
equal
deleted
inserted
replaced
1705:99c9f59ed365 | 1706:0e6ba1678d8e |
---|---|
367 end | 367 end |
368 end); | 368 end); |
369 | 369 |
370 function api:add_feature(xmlns) | 370 function api:add_feature(xmlns) |
371 self:add_item("feature", xmlns); | 371 self:add_item("feature", xmlns); |
372 features_table:set(self.host, self.name, xmlns, true); | |
373 end | 372 end |
374 function api:add_identity(category, type, name) | 373 function api:add_identity(category, type, name) |
375 self:add_item("identity", {category = category, type = type, name = name}); | 374 self:add_item("identity", {category = category, type = type, name = name}); |
376 identities_table:set(self.host, self.name, category.."\0"..type, {category = category, type = type, name = name}); | |
377 end | 375 end |
378 | 376 |
379 local event_hook = function(host, mod_name, event_name, ...) | 377 local event_hook = function(host, mod_name, event_name, ...) |
380 if type((...)) == "table" and (...).host and (...).host ~= host then return; end | 378 if type((...)) == "table" and (...).host and (...).host ~= host then return; end |
381 for handler in pairs(event_hooks:get(host, mod_name, event_name) or NULL) do | 379 for handler in pairs(event_hooks:get(host, mod_name, event_name) or NULL) do |