From 7404385817009bcffd56c8aa8f91ac14ea8fc53b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 19 Jan 2010 04:37:28 +0000 Subject: net.xmppserver_listener: Extend session:close() with a remote_reason parameter --- net/xmppserver_listener.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua index 5198a764..3def46b5 100644 --- a/net/xmppserver_listener.lua +++ b/net/xmppserver_listener.lua @@ -70,7 +70,7 @@ end local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" }; -local function session_close(session, reason) +local function session_close(session, reason, remote_reason) local log = session.log or log; if session.conn then if session.notopen then @@ -103,7 +103,7 @@ local function session_close(session, reason) session.conn:close(true); -- Force FIXME: timer? end session.conn:close(); - xmppserver.ondisconnect(session.conn, (reason and (reason.text or reason.condition)) or reason or "stream closed"); + xmppserver.ondisconnect(session.conn, remote_reason or (reason and (reason.text or reason.condition)) or reason or "stream closed"); end end -- cgit v1.2.3