Comparison

plugins/mod_csi_simple.lua @ 10833:ac691f305ea7

mod_csi_simple: Report whatever's not a stirng and not a stanza This is either dead code or actually a type error, but catching that should be the responsibility of the session.send function. This type check is left since everything after it assumes a stanza object. These last few commits aren't meant to change any behavior and it did mark things not stanzas as important, but those would have been mostly raw strings which are now specially handled.
author Kim Alvefur <zash@zash.se>
date Sun, 10 May 2020 23:12:33 +0200
parent 10832:7395f6e68dba
child 11260:08b397c21805
comparison
equal deleted inserted replaced
10832:7395f6e68dba 10833:ac691f305ea7
19 if stanza == " " then 19 if stanza == " " then
20 return true, "whitespace keepalive"; 20 return true, "whitespace keepalive";
21 elseif type(stanza) == "string" then 21 elseif type(stanza) == "string" then
22 return true, "raw data"; 22 return true, "raw data";
23 elseif not st.is_stanza(stanza) then 23 elseif not st.is_stanza(stanza) then
24 return true; 24 -- This should probably never happen
25 return true, type(stanza);
25 end 26 end
26 if stanza.attr.xmlns ~= nil then 27 if stanza.attr.xmlns ~= nil then
27 -- stream errors, stream management etc 28 -- stream errors, stream management etc
28 return true, "nonza"; 29 return true, "nonza";
29 end 30 end