X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_vcard.lua;h=e2f1dfb84cca78c504fdf1c3b39b1375c2e623f7;hb=fe004764ef568e5bc1eb9ed6e8fd4195938d9b3b;hp=3291d1c7a0926ebd8c59fe3ffffaa3ea8e62b408;hpb=81010cdd57e7bf53c14d5848dfee1f7960d097e9;p=prosody.git diff --git a/plugins/mod_vcard.lua b/plugins/mod_vcard.lua index 3291d1c7..e2f1dfb8 100644 --- a/plugins/mod_vcard.lua +++ b/plugins/mod_vcard.lua @@ -1,24 +1,18 @@ -- Prosody IM --- Copyright (C) 2008-2009 Matthew Wild --- Copyright (C) 2008-2009 Waqas Hussain +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- -local hosts = _G.hosts; -local datamanager = require "util.datamanager" - local st = require "util.stanza" -local t_concat, t_insert = table.concat, table.insert; - -local jid = require "util.jid" -local jid_split = jid.split; +local jid_split = require "util.jid".split; +local datamanager = require "util.datamanager" -local xmlns_vcard = "vcard-temp"; -module:add_feature(xmlns_vcard); +module:add_feature("vcard-temp"); -function handle_vcard(event) +local function handle_vcard(event) local session, stanza = event.origin, event.stanza; local to = stanza.attr.to; if stanza.attr.type == "get" then @@ -57,7 +51,7 @@ if module:get_option("vcard_compatibility") then module:hook("iq/full", function(data) local stanza = data.stanza; local payload = stanza.tags[1]; - if stanza.attr.type == "get" or stanza.attr.type == "set" and payload.name == "vCard" and payload.attr.xmlns == xmlns_vcard then + if stanza.attr.type == "get" and payload.name == "vCard" and payload.attr.xmlns == "vcard-temp" then return handle_vcard(data); end end, 1);