Fixed servermanager to use session.send for sending stanzas

Sun, 16 Nov 2008 05:02:15 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 16 Nov 2008 05:02:15 +0500
changeset 315
4df26c981728
parent 314
851f271d25b0
child 316
13e2bd256a20

Fixed servermanager to use session.send for sending stanzas

core/servermanager.lua file | annotate | diff | comparison | revisions
--- a/core/servermanager.lua	Sun Nov 16 04:52:11 2008 +0500
+++ b/core/servermanager.lua	Sun Nov 16 05:02:15 2008 +0500
@@ -1,6 +1,5 @@
 
 local st = require "util.stanza";
-local send = require "core.sessionmanager".send_to_session;
 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
 
 require "modulemanager"
@@ -11,10 +10,10 @@
 	if not modulemanager.handle_stanza(origin, stanza) then
 		if stanza.name == "iq" then
 			if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
-				send(origin, st.error_reply(stanza, "cancel", "service-unavailable"));
+				origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 			end
 		elseif stanza.name == "message" then
-			send(origin, st.error_reply(stanza, "cancel", "service-unavailable"));
+			origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 		elseif stanza.name ~= "presence" then
 			error("Unknown stanza");
 		end

mercurial