diff options
author | Kim Alvefur <zash@zash.se> | 2017-12-05 13:24:28 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-12-05 13:24:28 +0100 |
commit | e0ffb3ab1bedbbab2c9fff429f0866ebce678a52 (patch) | |
tree | d354b4a205cf98ffc59218e702948938febeec6d | |
parent | ce9705293d3b9db1a0144b8ee93e021cfb33ff0b (diff) | |
download | prosody-e0ffb3ab1bedbbab2c9fff429f0866ebce678a52.tar.gz prosody-e0ffb3ab1bedbbab2c9fff429f0866ebce678a52.zip |
mod_s2s: Restructure some code
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index a63892a5..0c1d7783 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -106,8 +106,15 @@ function route_to_existing_session(event) (host.log or log)("debug", "trying to send over unauthed s2sout to "..to_host); -- Queue stanza until we are able to send it - if host.sendq then t_insert(host.sendq, {tostring(stanza), stanza.attr.type ~= "error" and stanza.attr.type ~= "result" and st.reply(stanza)}); - else host.sendq = { {tostring(stanza), stanza.attr.type ~= "error" and stanza.attr.type ~= "result" and st.reply(stanza)} }; end + local queued_item = { + tostring(stanza), + stanza.attr.type ~= "error" and stanza.attr.type ~= "result" and st.reply(stanza); + }; + if host.sendq then + t_insert(host.sendq, queued_item); + else + host.sendq = { queued_item }; + end host.log("debug", "stanza [%s] queued ", stanza.name); return true; elseif host.type == "local" or host.type == "component" then |