aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_bosh.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-10-24 15:17:01 +0200
committerKim Alvefur <zash@zash.se>2021-10-24 15:17:01 +0200
commitef6cb64b9edf578685bedc02f72ed27bbc1d974f (patch)
tree42febf7fd157642a1eb3efe3cbd43e5c82d2d86a /plugins/mod_bosh.lua
parent94d9ba7ce14ebd30975f893e37e0defb0aeb080f (diff)
downloadprosody-ef6cb64b9edf578685bedc02f72ed27bbc1d974f.tar.gz
prosody-ef6cb64b9edf578685bedc02f72ed27bbc1d974f.zip
mod_c2s,etc: Identify stanza object with appropriate function
Better than duck typing, in case anyone ever passes a non-stanza table with a 'name' field.
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r--plugins/mod_bosh.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index fbd641da..ceb31a9f 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -236,6 +236,8 @@ local function bosh_close_stream(session, reason)
if type(reason) == "string" then -- assume stream error
close_reply:tag("stream:error")
:tag(reason, {xmlns = xmlns_xmpp_streams});
+ elseif st.is_stanza(reason) then
+ close_reply = reason;
elseif type(reason) == "table" then
if reason.condition then
close_reply:tag("stream:error")
@@ -246,8 +248,6 @@ local function bosh_close_stream(session, reason)
if reason.extra then
close_reply:add_child(reason.extra);
end
- elseif reason.name then -- a stanza
- close_reply = reason;
end
end
log("info", "Disconnecting client, <stream:error> is: %s", close_reply);