Comparison

plugins/mod_smacks.lua @ 12719:268b1a9162a9

mod_smacks: Add type field to results so actions can be later distinguished
author Matthew Wild <mwild1@gmail.com>
date Sat, 03 Sep 2022 21:20:07 +0100
parent 12691:90d90b540b6b
child 12720:0a137436490f
comparison
equal deleted inserted replaced
12718:27a4a7e64831 12719:268b1a9162a9
327 if resume == "true" or resume == "1" then 327 if resume == "true" or resume == "1" then
328 resume_token = new_id(); 328 resume_token = new_id();
329 end 329 end
330 330
331 return { 331 return {
332 type = "enabled";
332 id = resume_token; 333 id = resume_token;
333 resume_max = resume_token and tostring(resume_timeout) or nil; 334 resume_max = resume_token and tostring(resume_timeout) or nil;
334 session = session; 335 session = session;
335 finish = function () 336 finish = function ()
336 session.log("debug", "Enabling stream management"); 337 session.log("debug", "Enabling stream management");
337 338
338 track_session(session, resume_token); 339 track_session(session, resume_token);
339 wrap_session(session, false); 340 wrap_session(session, false);
340
341 end; 341 end;
342 }; 342 };
343 end 343 end
344 344
345 function handle_enable(session, stanza, xmlns_sm) 345 function handle_enable(session, stanza, xmlns_sm)
611 611
612 -- Update original_session with the parameters (connection, etc.) from the new session 612 -- Update original_session with the parameters (connection, etc.) from the new session
613 sessionmanager.update_session(original_session, session); 613 sessionmanager.update_session(original_session, session);
614 614
615 return { 615 return {
616 type = "resumed";
616 session = original_session; 617 session = original_session;
617 id = id; 618 id = id;
618 -- Return function to complete the resumption and resync unacked stanzas 619 -- Return function to complete the resumption and resync unacked stanzas
619 -- This is two steps so we can support SASL2/ISR 620 -- This is two steps so we can support SASL2/ISR
620 finish = function () 621 finish = function ()