aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-14 12:59:38 +0100
committerKim Alvefur <zash@zash.se>2021-12-14 12:59:38 +0100
commit9c747a1dbca08e021d3971c65d8d6e65ed1ea331 (patch)
treecd298fb78858bfb8db3ed5d88785a77dc43fca6c /plugins/mod_smacks.lua
parentccd96b3fa31f82dfe1faf4dc7e24d7f921db7180 (diff)
downloadprosody-9c747a1dbca08e021d3971c65d8d6e65ed1ea331.tar.gz
prosody-9c747a1dbca08e021d3971c65d8d6e65ed1ea331.zip
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.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 3d95c4af..04010b4e 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -606,11 +606,14 @@ function handle_resume(session, stanza, xmlns_sm)
-- 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));