Changeset

4813:0a257d1402c3

mod_muc_rtbl: Optimize case with zero hashes On the assumption that during quiet times between torrents of spam, the hash set would be empty. There would be no point in doing the operations and hashes to check for a match in that case.
author Kim Alvefur <zash@zash.se>
date Mon, 06 Dec 2021 18:19:19 +0100
parents 4812:9cdbb1b5e6f2
children 4814:5f12c75fd210
files mod_muc_rtbl/mod_muc_rtbl.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_rtbl/mod_muc_rtbl.lua	Mon Dec 06 12:27:16 2021 +0000
+++ b/mod_muc_rtbl/mod_muc_rtbl.lua	Mon Dec 06 18:19:19 2021 +0100
@@ -92,6 +92,8 @@
 module:hook("iq-result/host/rtbl-request", update_list);
 
 module:hook("muc-occupant-pre-join", function (event)
+	if next(banned_hashes) == nil then return end
+
 	local from_bare = jid.bare(event.stanza.attr.from);
 
 	local affiliation = event.room:get_affiliation(from_bare);