comparison 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
comparison
equal deleted inserted replaced
5174:354832098f2f 5175:432587ad1642
92 module:hook("iq-result/host/rtbl-request", update_list); 92 module:hook("iq-result/host/rtbl-request", update_list);
93 93
94 function update_hashes(occupant) 94 function update_hashes(occupant)
95 local bare_hash, host_hash; 95 local bare_hash, host_hash;
96 if not occupant.mod_muc_rtbl_bare_hash then 96 if not occupant.mod_muc_rtbl_bare_hash then
97 bare_hash = sha256(jid.bare(event.stanza.attr.from), true); 97 bare_hash = sha256(jid.bare(occupant.bare_jid), true);
98 occupant.mod_muc_rtbl_bare_hash = bare_hash; 98 occupant.mod_muc_rtbl_bare_hash = bare_hash;
99 else 99 else
100 bare_hash = occupant.mod_muc_rtbl_bare_hash; 100 bare_hash = occupant.mod_muc_rtbl_bare_hash;
101 end 101 end
102 if not occupant.mod_muc_rtbl_host_hash then 102 if not occupant.mod_muc_rtbl_host_hash then
103 host_hash = sha256(jid.host(event.stanza.attr.from), true); 103 host_hash = sha256(jid.host(occupant.bare_jid), true);
104 event.occupant.mod_muc_rtbl_host_hash = host_hash; 104 event.occupant.mod_muc_rtbl_host_hash = host_hash;
105 else 105 else
106 host_hash = event.occupant.mod_muc_rtbl_host_hash; 106 host_hash = event.occupant.mod_muc_rtbl_host_hash;
107 end 107 end
108 return bare_hash, host_hash 108 return bare_hash, host_hash