Mercurial > prosody-modules
comparison mod_bidi/mod_bidi.lua @ 1126:6fd328b8e136
mod_bidi: Don't try to send on destroyed sessions
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 03 Aug 2013 00:51:00 +0200 |
parents | 901e361af918 |
children | 38e56be11584 |
comparison
equal
deleted
inserted
replaced
1125:901e361af918 | 1126:6fd328b8e136 |
---|---|
57 | 57 |
58 module:hook("route/remote", function(event) | 58 module:hook("route/remote", function(event) |
59 local from_host, to_host, stanza = event.from_host, event.to_host, event.stanza; | 59 local from_host, to_host, stanza = event.from_host, event.to_host, event.stanza; |
60 if from_host ~= module.host then return end | 60 if from_host ~= module.host then return end |
61 local to_session = bidi_sessions[to_host] | 61 local to_session = bidi_sessions[to_host] |
62 if not to_session then return end | 62 if not to_session or to_session.type ~= "s2sin" then return end |
63 return to_session.sends2s(stanza); | 63 return to_session.sends2s(stanza); |
64 end, -2); | 64 end, -2); |
65 | 65 |
66 -- Incoming s2s | 66 -- Incoming s2s |
67 module:hook("s2s-stream-features", function(event) | 67 module:hook("s2s-stream-features", function(event) |