comparison mod_smacks/mod_smacks.lua @ 1599:8e006226e4c5

mod_smacks: Don't attach timestamps to 'iq' stanzas
author Kim Alvefur <zash@zash.se>
date Mon, 26 Jan 2015 15:54:18 +0100
parents 043d08448d87
children ad6694f7b13c
comparison
equal deleted inserted replaced
1598:043d08448d87 1599:8e006226e4c5
62 if is_stanza and not stanza._cached then -- Stanza in default stream namespace 62 if is_stanza and not stanza._cached then -- Stanza in default stream namespace
63 local queue = session.outgoing_stanza_queue; 63 local queue = session.outgoing_stanza_queue;
64 local cached_stanza = st.clone(stanza); 64 local cached_stanza = st.clone(stanza);
65 cached_stanza._cached = true; 65 cached_stanza._cached = true;
66 66
67 if cached_stanza and cached_stanza:get_child("delay", xmlns_delay) == nil then 67 if cached_stanza and cached_stanza.name ~= "iq" and cached_stanza:get_child("delay", xmlns_delay) == nil then
68 cached_stanza = cached_stanza:tag("delay", { xmlns = xmlns_delay, from = session.host, stamp = datetime.datetime()}); 68 cached_stanza = cached_stanza:tag("delay", { xmlns = xmlns_delay, from = session.host, stamp = datetime.datetime()});
69 end 69 end
70 70
71 queue[#queue+1] = cached_stanza; 71 queue[#queue+1] = cached_stanza;
72 session.log("debug", "#queue = %d", #queue); 72 session.log("debug", "#queue = %d", #queue);