Comparison

plugins/mod_smacks.lua @ 12066:f07c8240a71d

mod_smacks: Split log messages for when an old session exists in storage Non-existent did not seem entirely accurate for this case
author Kim Alvefur <zash@zash.se>
date Fri, 17 Dec 2021 16:29:17 +0100
parent 12065:9102cbd2aec4
child 12067:97c377de8083
comparison
equal deleted inserted replaced
12065:9102cbd2aec4 12066:f07c8240a71d
495 end 495 end
496 496
497 local id = stanza.attr.previd; 497 local id = stanza.attr.previd;
498 local original_session = session_registry[jid.join(session.username, session.host, id)]; 498 local original_session = session_registry[jid.join(session.username, session.host, id)];
499 if not original_session then 499 if not original_session then
500 session.log("debug", "Tried to resume non-existent session with id %s", id);
501 local old_session = old_session_registry:get(session.username, id); 500 local old_session = old_session_registry:get(session.username, id);
502 if old_session then 501 if old_session then
502 session.log("debug", "Tried to resume old expired session with id %s", id);
503 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(old_session.h) }) 503 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(old_session.h) })
504 :tag("item-not-found", { xmlns = xmlns_errors }) 504 :tag("item-not-found", { xmlns = xmlns_errors })
505 ); 505 );
506 old_session_registry:set(session.username, id, nil); 506 old_session_registry:set(session.username, id, nil);
507 else 507 else
508 session.log("debug", "Tried to resume non-existent session with id %s", id);
508 session.send(st.stanza("failed", { xmlns = xmlns_sm }) 509 session.send(st.stanza("failed", { xmlns = xmlns_sm })
509 :tag("item-not-found", { xmlns = xmlns_errors }) 510 :tag("item-not-found", { xmlns = xmlns_errors })
510 ); 511 );
511 end; 512 end;
512 else 513 else