Comparison

mod_smacks/mod_smacks.lua @ 2608:362ca94192ee

mod_smacks: Add resumed session to event "smacks-hibernation-end" Older versions of this event only have the "intermediate" session in event.session (the one used to resume the existing session), but not the resumed one. This adds event.resumed which contains the resumed one alongside to event.session.
author tmolitor <thilo@eightysoft.de>
date Sat, 11 Mar 2017 01:37:28 +0100
parent 2596:ffb6646b4253
child 2623:a65260300708
comparison
equal deleted inserted replaced
2607:a7ef9b765891 2608:362ca94192ee
490 h = stanza.attr.h })); 490 h = stanza.attr.h }));
491 491
492 -- Ok, we need to re-send any stanzas that the client didn't see 492 -- Ok, we need to re-send any stanzas that the client didn't see
493 -- ...they are what is now left in the outgoing stanza queue 493 -- ...they are what is now left in the outgoing stanza queue
494 local queue = original_session.outgoing_stanza_queue; 494 local queue = original_session.outgoing_stanza_queue;
495 module:fire_event("smacks-hibernation-end", {origin = session, queue = queue}); 495 module:fire_event("smacks-hibernation-end", {origin = session, resumed = original_session, queue = queue});
496 session.log("debug", "#queue = %d", #queue); 496 session.log("debug", "#queue = %d", #queue);
497 for i=1,#queue do 497 for i=1,#queue do
498 session.send(queue[i]); 498 session.send(queue[i]);
499 end 499 end
500 session.log("debug", "#queue = %d -- after send", #queue); 500 session.log("debug", "#queue = %d -- after send", #queue);