mod_vcard: Cleaned up unused variables and global accesses.

Sun, 18 Oct 2009 07:40:14 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 18 Oct 2009 07:40:14 +0500
changeset 2004
5033348feba8
parent 2003
b7429073f73f
child 2005
478ba7e85862

mod_vcard: Cleaned up unused variables and global accesses.

plugins/mod_vcard.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_vcard.lua	Sun Oct 18 07:33:24 2009 +0500
+++ b/plugins/mod_vcard.lua	Sun Oct 18 07:40:14 2009 +0500
@@ -6,19 +6,13 @@
 -- COPYING file in the source package for more information.
 --
 
-local hosts = _G.hosts;
+local st = require "util.stanza"
+local jid_split = require "util.jid".split;
 local datamanager = require "util.datamanager"
 
-local st = require "util.stanza"
-local t_concat, t_insert = table.concat, table.insert;
+module:add_feature("vcard-temp");
 
-local jid = require "util.jid"
-local jid_split = jid.split;
-
-local xmlns_vcard = "vcard-temp";
-module:add_feature(xmlns_vcard);
-
-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 @@
 	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" or stanza.attr.type == "set" and payload.name == "vCard" and payload.attr.xmlns == "vcard-temp" then
 			return handle_vcard(data);
 		end
 	end, 1);

mercurial