diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-10-18 07:05:56 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-10-18 07:05:56 +0500 |
commit | 77412b780cfa6a144452f9af2b851a4422e878f8 (patch) | |
tree | 837a3dcc3e6ff4fd3936698eb06ff1992da396ef /plugins | |
parent | 17a29f515887a503474461ec942422175a63084f (diff) | |
download | prosody-77412b780cfa6a144452f9af2b851a4422e878f8.tar.gz prosody-77412b780cfa6a144452f9af2b851a4422e878f8.zip |
mod_vcard: Moved completely to new event based hooks.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_vcard.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/mod_vcard.lua b/plugins/mod_vcard.lua index c84095e8..ca1c52ee 100644 --- a/plugins/mod_vcard.lua +++ b/plugins/mod_vcard.lua @@ -21,7 +21,8 @@ local xmlns_vcard = "vcard-temp"; module:add_feature(xmlns_vcard); -function handle_vcard(session, stanza) +function handle_vcard(event) + local session, stanza = event.origin, event.stanza; if stanza.tags[1].name == "vCard" then local to = stanza.attr.to; if stanza.attr.type == "get" then @@ -55,7 +56,9 @@ function handle_vcard(session, stanza) end end -module:add_iq_handler({"c2s", "s2sin", "component"}, xmlns_vcard, handle_vcard); +--module:add_iq_handler({"c2s", "s2sin", "component"}, xmlns_vcard, handle_vcard); +module:hook("iq/bare/vcard-temp:vCard", handle_vcard); +module:hook("iq/host/vcard-temp:vCard", handle_vcard); -- COMPAT: https://support.process-one.net/browse/EJAB-1045 if module:get_option("vcard_compatibility") then @@ -63,7 +66,7 @@ if module:get_option("vcard_compatibility") then local stanza = data.stanza; if stanza.attr.type == "get" and stanza.tags[1] and stanza.tags[1].attr.xmlns == xmlns_vcard then - return handle_vcard(data.origin, stanza); + return handle_vcard(data); end end, 1); end |