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 |