Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1697:f1783e621a36
modulemanager: Module API functions add_item and add_feature updated to use the add_item API
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 18 Aug 2009 12:34:59 +0500 |
parent | 1695:9786e650393b |
child | 1698:af89f646200f |
comparison
equal
deleted
inserted
replaced
1696:2afc87ccc379 | 1697:f1783e621a36 |
---|---|
366 return next(done) ~= nil; | 366 return next(done) ~= nil; |
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 features_table:set(self.host, self.name, xmlns, true); | 372 features_table:set(self.host, self.name, xmlns, true); |
372 end | 373 end |
373 function api:add_identity(category, type, name) | 374 function api:add_identity(category, type, name) |
375 self:add_item("identity", {category = category, type = type, name = name}); | |
374 identities_table:set(self.host, self.name, category.."\0"..type, {category = category, type = type, name = name}); | 376 identities_table:set(self.host, self.name, category.."\0"..type, {category = category, type = type, name = name}); |
375 end | 377 end |
376 | 378 |
377 local event_hook = function(host, mod_name, event_name, ...) | 379 local event_hook = function(host, mod_name, event_name, ...) |
378 if type((...)) == "table" and (...).host and (...).host ~= host then return; end | 380 if type((...)) == "table" and (...).host and (...).host ~= host then return; end |