Software /
code /
prosody-modules
Comparison
mod_smacks/mod_smacks.lua @ 4681:edbd84bbd8fb
mod_smacks: Include username in offline event, mirroring Prosody 0.10+
See Prosody rev 03714861f8fc and 72a2b85c0537
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 12 Sep 2021 21:14:26 +0200 |
parent | 4637:242251ce1036 |
child | 4760:367a8020bd92 |
comparison
equal
deleted
inserted
replaced
4680:59fdda04b87e | 4681:edbd84bbd8fb |
---|---|
459 end | 459 end |
460 -- store message in offline store, if this client does not use mam *and* was the last client online | 460 -- store message in offline store, if this client does not use mam *and* was the last client online |
461 local sessions = prosody.hosts[module.host].sessions[session.username] and | 461 local sessions = prosody.hosts[module.host].sessions[session.username] and |
462 prosody.hosts[module.host].sessions[session.username].sessions or nil; | 462 prosody.hosts[module.host].sessions[session.username].sessions or nil; |
463 if sessions and next(sessions) == session.resource and next(sessions, session.resource) == nil then | 463 if sessions and next(sessions) == session.resource and next(sessions, session.resource) == nil then |
464 local ok = module:fire_event("message/offline/handle", { origin = session, stanza = stanza } ); | 464 local ok = module:fire_event("message/offline/handle", { origin = session, username = session.username, stanza = stanza }); |
465 session.log("debug", "mod_smacks delivery/failuere returning %s for offline-handled stanza", tostring(ok)); | 465 session.log("debug", "mod_smacks delivery/failuere returning %s for offline-handled stanza", tostring(ok)); |
466 return ok; -- if stanza was handled, don't send an error | 466 return ok; -- if stanza was handled, don't send an error |
467 end | 467 end |
468 end | 468 end |
469 end | 469 end |