mod_c2s: Fix session:close() when a stanza is passed as reason
authorKim Alvefur <zash@zash.se>
Fri, 10 May 2013 22:29:03 +0200
changeset 5571 ae9672f4079a
parent 5569 c45997aebaa2
child 5572 19e1f9881bfc
child 5573 ca9f99f7dcbc
mod_c2s: Fix session:close() when a stanza is passed as reason
plugins/mod_c2s.lua
--- a/plugins/mod_c2s.lua	Thu May 09 11:13:18 2013 +0200
+++ b/plugins/mod_c2s.lua	Fri May 10 22:29:03 2013 +0200
@@ -157,7 +157,7 @@
 		session.send("</stream:stream>");
 		function session.send() return false; end
 		
-		local reason = (reason and (reason.text or reason.condition)) or reason;
+		local reason = (reason and (reason.name or reason.text or reason.condition)) or reason;
 		session.log("info", "c2s stream for %s closed: %s", session.full_jid or ("<"..session.ip..">"), reason or "session closed");
 
 		-- Authenticated incoming stream may still be sending us stanzas, so wait for </stream:stream> from remote