mod_muc_rtbl: Handle node purge
authorKim Alvefur <zash@zash.se>
Fri, 17 Mar 2023 22:29:55 +0100
changeset 5278 8cfbcbc0fb89
parent 5277 40be37652d70
child 5279 3e30799deec2
mod_muc_rtbl: Handle node purge Prevents the module from going out of sync with the node in case this event ever happens.
mod_muc_rtbl/mod_muc_rtbl.lua
--- a/mod_muc_rtbl/mod_muc_rtbl.lua	Fri Mar 24 00:07:58 2023 +0100
+++ b/mod_muc_rtbl/mod_muc_rtbl.lua	Fri Mar 17 22:29:55 2023 +0100
@@ -38,6 +38,13 @@
 		module:log("debug", "Retracted hash: %s", hash);
 		banned_hashes[hash] = nil;
 	end;
+
+	purge = function()
+		module:log("debug", "Purge all hashes");
+		for hash in pairs(banned_hashes) do
+			banned_hashes[hash] = nil;
+		end
+	end;
 });
 
 function request_list()