# HG changeset patch # User Kim Alvefur # Date 1410878672 -7200 # Node ID b8164f18142ad12dbc3112f8c544eb1b8ad7e3c7 # Parent c4c9ccc6e6c9a1f951e865ff57ecaab48e2ee1e6 mod_throttle_presence: Make sure flushed stanzas get through the filter diff -r c4c9ccc6e6c9 -r b8164f18142a mod_throttle_presence/mod_throttle_presence.lua --- a/mod_throttle_presence/mod_throttle_presence.lua Tue Sep 16 16:23:15 2014 +0200 +++ b/mod_throttle_presence/mod_throttle_presence.lua Tue Sep 16 16:44:32 2014 +0200 @@ -4,12 +4,18 @@ module:depends("csi"); local function presence_filter(stanza, session) + if stanza._flush then + stanza._flush = nil; + return stanza; + end local buffer = session.presence_buffer; local from = stanza.attr.from; if stanza.name ~= "presence" or (stanza.attr.type and stanza.attr.type ~= "unavailable") then local cached_presence = buffer[stanza.attr.from]; if cached_presence then module:log("debug", "Important stanza for %s from %s, flushing presence", session.full_jid, from); + stanza._flush = true; + cached_presence._flush = true; session.send(cached_presence); buffer[stanza.attr.from] = nil; end