diff options
-rw-r--r-- | net/xmppclient_listener.lua | 4 | ||||
-rw-r--r-- | plugins/mod_message.lua | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index 617f0467..5e1a1ba3 100644 --- a/net/xmppclient_listener.lua +++ b/net/xmppclient_listener.lua @@ -95,7 +95,7 @@ local function session_close(session, reason) end session.send("</stream:stream>"); session.conn.close(); - xmppclient.disconnect(session.conn, "stream error"); + xmppclient.disconnect(session.conn, reason.condition or reason or "session closed"); end end @@ -136,7 +136,7 @@ function xmppclient.disconnect(conn, err) local session = sessions[conn]; if session then (session.log or log)("info", "Client disconnected: %s", err); - sm_destroy_session(session); + sm_destroy_session(session, err); sessions[conn] = nil; session = nil; collectgarbage("collect"); diff --git a/plugins/mod_message.lua b/plugins/mod_message.lua index 72ccfdd0..b56aef0a 100644 --- a/plugins/mod_message.lua +++ b/plugins/mod_message.lua @@ -67,3 +67,5 @@ module:hook("message/bare", function(data) return process_to_bare(stanza.attr.to or (origin.username..'@'..origin.host), origin, stanza); end); + +module:add_feature("msgoffline"); |