# HG changeset patch # User Kim Alvefur # Date 1639483178 -3600 # Node ID 81858fd6f198a1267d7758216f2bcde6e1078d39 # Parent 372ec5cd0f5198639fa1ef0e2b6b13c7c37d056b mod_smacks: Flag both sessions to prevent duplicating queue on resumption I have no idea what is going on in this code, which session is which? Something has one of the sessions as an upvalue which is where the filter checks for it. diff -r 372ec5cd0f51 -r 81858fd6f198 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Mon Dec 06 11:49:22 2021 +0100 +++ b/plugins/mod_smacks.lua Tue Dec 14 12:59:38 2021 +0100 @@ -606,11 +606,14 @@ -- to the outgoing queue again local queue = original_session.outgoing_stanza_queue; session.log("debug", "resending all unacked stanzas that are still queued after resume, #queue = %d", #queue); + -- FIXME Which session is it that the queue filter sees? session.resending_unacked = true; + original_session.resending_unacked = true; for i=1,#queue do session.send(queue[i]); end session.resending_unacked = nil; + original_session.resending_unacked = nil; session.log("debug", "all stanzas resent, now disabling send() in this migrated session, #queue = %d", #queue); function session.send(stanza) -- luacheck: ignore 432 migrated_session_log("error", "Tried to send stanza on old session migrated by smacks resume (maybe there is a bug?): %s", tostring(stanza));