Comparison

plugins/mod_smacks.lua @ 11983:27f2539b4f87

mod_smacks: Remove dead conditional `cached_stanza` can't be falsy because util.stanza.clone() would have thrown rather than return nil, or `._cached=true` would have.
author Kim Alvefur <zash@zash.se>
date Thu, 02 Dec 2021 13:49:42 +0100
parent 11982:c7c0c40487e2
child 11984:a86ae74da96c
comparison
equal deleted inserted replaced
11982:c7c0c40487e2 11983:27f2539b4f87
205 if is_stanza and not stanza._cached then 205 if is_stanza and not stanza._cached then
206 local queue = session.outgoing_stanza_queue; 206 local queue = session.outgoing_stanza_queue;
207 local cached_stanza = st.clone(stanza); 207 local cached_stanza = st.clone(stanza);
208 cached_stanza._cached = true; 208 cached_stanza._cached = true;
209 209
210 if cached_stanza and cached_stanza.name ~= "iq" and cached_stanza:get_child("delay", xmlns_delay) == nil then 210 if cached_stanza.name ~= "iq" and cached_stanza:get_child("delay", xmlns_delay) == nil then
211 cached_stanza = cached_stanza:tag("delay", { 211 cached_stanza = cached_stanza:tag("delay", {
212 xmlns = xmlns_delay, 212 xmlns = xmlns_delay,
213 from = jid.bare(session.full_jid or session.host), 213 from = jid.bare(session.full_jid or session.host),
214 stamp = datetime.datetime() 214 stamp = datetime.datetime()
215 }); 215 });