Merge with 0.5
[prosody.git] / plugins / mod_vcard.lua
index 10119252f25bec4fd3f648764f13bca55c9a9d7c..be856897424f024cec00e8949ce4e44bc64aed2e 100644 (file)
@@ -1,36 +1,25 @@
--- Prosody IM v0.2
--- Copyright (C) 2008 Matthew Wild
--- Copyright (C) 2008 Waqas Hussain
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
 -- 
--- This program is free software; you can redistribute it and/or
--- modify it under the terms of the GNU General Public License
--- as published by the Free Software Foundation; either version 2
--- of the License, or (at your option) any later version.
--- 
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
--- 
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
 --
 
 
 
-require "util.datamanager"
-local datamanager = datamanager;
+local hosts = _G.hosts;
+local datamanager = require "util.datamanager"
 
 local st = require "util.stanza"
 local t_concat, t_insert = table.concat, table.insert;
 
-require "util.jid"
+local jid = require "util.jid"
 local jid_split = jid.split;
 
 module:add_feature("vcard-temp");
 
-module:add_iq_handler({"c2s", "s2sin"}, "vcard-temp", 
+module:add_iq_handler({"c2s", "s2sin", "component"}, "vcard-temp", 
                function (session, stanza)
                        if stanza.tags[1].name == "vCard" then
                                local to = stanza.attr.to;