plugins.legacy: Make functions local

Fri, 01 May 2015 23:33:08 +0200

author
Kim Alvefur <zash@zash.se>
date
Fri, 01 May 2015 23:33:08 +0200
changeset 381
65533afab352
parent 380
0891b4e27766
child 382
479b856a910f

plugins.legacy: Make functions local

plugins/legacy.lua file | annotate | diff | comparison | revisions
--- a/plugins/legacy.lua	Fri May 01 23:27:29 2015 +0200
+++ b/plugins/legacy.lua	Fri May 01 23:33:08 2015 +0200
@@ -4,7 +4,7 @@
 local xmlns_auth = "jabber:iq:auth";
 
 function verse.plugins.legacy(stream)
-	function handle_auth_form(result)
+	local function handle_auth_form(result)
 		local query = result:get_child("query", xmlns_auth);
 		if result.attr.type ~= "result" or not query then
 			local type, cond, text = result:get_error();
@@ -52,13 +52,12 @@
 		end);
 	end
 
-	function handle_opened(attr)
+	local function handle_opened(attr)
 		if not attr.version then
 			stream:send_iq(verse.iq({type="get"})
 				:tag("query", { xmlns = "jabber:iq:auth" })
 					:tag("username"):text(stream.username),
 				handle_auth_form);
-
 		end
 	end
 	stream:hook("opened", handle_opened);

mercurial