Changeset

308:6345cf3e994a

Fixed mod_legacyauth to use session.send for sending stanzas
author Waqas Hussain <waqas20@gmail.com>
date Sun, 16 Nov 2008 04:36:34 +0500
parents 307:8ff052a77cac
children 309:d9c8825b7332
files plugins/mod_legacyauth.lua
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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