Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1695:9786e650393b
modulemanager: Changed the add_identity module API to accept an optional name parameter (the 'name' attribute for the <identity/> element)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 18 Aug 2009 12:32:38 +0500 |
parent | 1694:0b7888c0995d |
child | 1697:f1783e621a36 |
comparison
equal
deleted
inserted
replaced
1694:0b7888c0995d | 1695:9786e650393b |
---|---|
368 end); | 368 end); |
369 | 369 |
370 function api:add_feature(xmlns) | 370 function api:add_feature(xmlns) |
371 features_table:set(self.host, self.name, xmlns, true); | 371 features_table:set(self.host, self.name, xmlns, true); |
372 end | 372 end |
373 function api:add_identity(category, type) | 373 function api:add_identity(category, type, name) |
374 identities_table:set(self.host, self.name, category.."\0"..type, {category = category, type = type}); | 374 identities_table:set(self.host, self.name, category.."\0"..type, {category = category, type = type, name = name}); |
375 end | 375 end |
376 | 376 |
377 local event_hook = function(host, mod_name, event_name, ...) | 377 local event_hook = function(host, mod_name, event_name, ...) |
378 if type((...)) == "table" and (...).host and (...).host ~= host then return; end | 378 if type((...)) == "table" and (...).host and (...).host ~= host then return; end |
379 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 |