Changeset

624:55a9d3c2f73b

mod_smacks: Import connlisteners properly
author Matthew Wild <mwild1@gmail.com>
date Sat, 17 Mar 2012 15:54:25 +0000
parents 623:c1f3958695ea
children 625:2c07bcf56a36
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Sat Mar 17 15:53:45 2012 +0000
+++ b/mod_smacks/mod_smacks.lua	Sat Mar 17 15:54:25 2012 +0000
@@ -8,6 +8,7 @@
 local add_filter = require "util.filters".add_filter;
 local timer = require "util.timer";
 local datetime = require "util.datetime";
+local connlisteners = require "net.connlisteners";
 
 local xmlns_sm = "urn:xmpp:sm:2";
 local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas";
@@ -255,7 +256,7 @@
 		if original_session.conn then
 			session.log("debug", "mod_smacks closing an old connection for this session");
 			local conn = original_session.conn;
-			require "net.connlisteners".get("xmppclient").associate_session(conn, nil);
+			connlisteners.get("xmppclient").associate_session(conn, nil);
 			conn:close();
 		end
 		original_session.ip = session.ip;
@@ -280,7 +281,7 @@
 		-- Inform xmppstream of the new session (passed to its callbacks)
 		stream:set_session(original_session);
 		-- Similar for connlisteners
-		require "net.connlisteners".get("xmppclient").associate_session(session.conn, original_session);
+		connlisteners.get("xmppclient").associate_session(session.conn, original_session);
 
 		session.send(st.stanza("resumed", { xmlns = xmlns_sm,
 			h = original_session.handled_stanza_count, previd = id }));