Fixed mod_legacyauth to use session.send for sending stanzas

Sun, 16 Nov 2008 04:36:34 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 16 Nov 2008 04:36:34 +0500
changeset 308
6345cf3e994a
parent 307
8ff052a77cac
child 309
d9c8825b7332

Fixed mod_legacyauth to use session.send for sending stanzas

plugins/mod_legacyauth.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_legacyauth.lua	Sun Nov 16 04:28:37 2008 +0500
+++ b/plugins/mod_legacyauth.lua	Sun Nov 16 04:36:34 2008 +0500
@@ -1,6 +1,5 @@
 
 local st = require "util.stanza";
-local send = require "core.sessionmanager".send_to_session;
 local t_concat = table.concat;
 
 add_iq_handler("c2s_unauthed", "jabber:iq:auth", 
@@ -10,7 +9,7 @@
 			local resource = stanza.tags[1]:child_with_name("resource");
 			if not (username and password and resource) then
 				local reply = st.reply(stanza);
-				send(session, reply:query("jabber:iq:auth")
+				session.send(reply:query("jabber:iq:auth")
 					:tag("username"):up()
 					:tag("password"):up()
 					:tag("resource"):up());
@@ -30,14 +29,14 @@
 							return true;
 						end
 					end
-					send(session, st.reply(stanza));
+					session.send(st.reply(stanza));
 					return true;
 				else
 					local reply = st.reply(stanza);
 					reply.attr.type = "error";
 					reply:tag("error", { code = "401", type = "auth" })
 						:tag("not-authorized", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" });
-					send(session, reply);
+					session.send(reply);
 					return true;
 				end
 			end

mercurial