Diff

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
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Sun Sep 12 19:27:06 2021 +0100
+++ b/mod_smacks/mod_smacks.lua	Sun Sep 12 21:14:26 2021 +0200
@@ -461,7 +461,7 @@
 			local sessions = prosody.hosts[module.host].sessions[session.username] and
 					prosody.hosts[module.host].sessions[session.username].sessions or nil;
 			if sessions and next(sessions) == session.resource and next(sessions, session.resource) == nil then
-				local ok = module:fire_event("message/offline/handle", { origin = session, stanza = stanza } );
+				local ok = module:fire_event("message/offline/handle", { origin = session, username = session.username, stanza = stanza });
 				session.log("debug", "mod_smacks delivery/failuere returning %s for offline-handled stanza", tostring(ok));
 				return ok;			-- if stanza was handled, don't send an error
 			end