diff mod_bidi/mod_bidi.lua @ 1128:6b344b7e4781

mod_bidi: Allow route/remote event to continue if we couldn't send a stanza (in case the session was destroyed)
author Kim Alvefur <zash@zash.se>
date Sat, 03 Aug 2013 00:56:15 +0200
parents 38e56be11584
children ae0fa4d2005d
line wrap: on
line diff
--- a/mod_bidi/mod_bidi.lua	Sat Aug 03 00:53:09 2013 +0200
+++ b/mod_bidi/mod_bidi.lua	Sat Aug 03 00:56:15 2013 +0200
@@ -58,9 +58,9 @@
 module:hook("route/remote", function(event)
 	local from_host, to_host, stanza = event.from_host, event.to_host, event.stanza;
 	if from_host ~= module.host then return end
-	local to_session = bidi_sessions[to_host]
+	local to_session = bidi_sessions[to_host];
 	if not to_session or to_session.type ~= "s2sin" then return end
-	return to_session.sends2s(stanza);
+	if to_session.send(stanza) then return true end
 end, -2);
 
 -- Incoming s2s