Comparison

plugins/mod_s2s/mod_s2s.lua @ 10476:035027a868bc

mod_s2s: Use stanza type check instead of duck typing
author Kim Alvefur <zash@zash.se>
date Sun, 01 Dec 2019 12:19:36 +0100
parent 10473:b2dd1219a321
child 10477:28755107c2f4
comparison
equal deleted inserted replaced
10475:fa0cad7c89e3 10476:035027a868bc
519 stanza:add_child(reason.extra); 519 stanza:add_child(reason.extra);
520 end 520 end
521 log("debug", "Disconnecting %s[%s], <stream:error> is: %s", 521 log("debug", "Disconnecting %s[%s], <stream:error> is: %s",
522 session.host or session.ip or "(unknown host)", session.type, stanza); 522 session.host or session.ip or "(unknown host)", session.type, stanza);
523 session.sends2s(stanza); 523 session.sends2s(stanza);
524 elseif reason.name then -- a stanza 524 elseif st.is_stanza(reason) then
525 log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s", 525 log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s",
526 session.from_host or "(unknown host)", session.to_host or "(unknown host)", 526 session.from_host or "(unknown host)", session.to_host or "(unknown host)",
527 session.type, reason); 527 session.type, reason);
528 session.sends2s(reason); 528 session.sends2s(reason);
529 end 529 end