diff mod_muc_rtbl/mod_muc_rtbl.lua @ 5175:432587ad1642

mod_muc_rtbl: fix traceback because of scoping error There is no "event" there, we have to use the occupant data instead. That's what you get for moving code around!
author Jonas Schäfer <jonas@wielicki.name>
date Wed, 22 Feb 2023 13:33:16 +0100
parents 354832098f2f
children 4791e0412ff3
line wrap: on
line diff
--- a/mod_muc_rtbl/mod_muc_rtbl.lua	Tue Feb 21 21:41:19 2023 +0100
+++ b/mod_muc_rtbl/mod_muc_rtbl.lua	Wed Feb 22 13:33:16 2023 +0100
@@ -94,13 +94,13 @@
 function update_hashes(occupant)
 	local bare_hash, host_hash;
 	if not occupant.mod_muc_rtbl_bare_hash then
-		bare_hash = sha256(jid.bare(event.stanza.attr.from), true);
+		bare_hash = sha256(jid.bare(occupant.bare_jid), true);
 		occupant.mod_muc_rtbl_bare_hash = bare_hash;
 	else
 		bare_hash = occupant.mod_muc_rtbl_bare_hash;
 	end
 	if not occupant.mod_muc_rtbl_host_hash then
-		host_hash = sha256(jid.host(event.stanza.attr.from), true);
+		host_hash = sha256(jid.host(occupant.bare_jid), true);
 		event.occupant.mod_muc_rtbl_host_hash = host_hash;
 	else
 		host_hash = event.occupant.mod_muc_rtbl_host_hash;