Diff

plugins/mod_mam/mod_mam.lua @ 13230:26c30844cac6

plugins: Handle how get_option_period returns "never"
author Kim Alvefur <zash@zash.se>
date Fri, 21 Jul 2023 17:23:00 +0200
parent 13213:50324f66ca2a
line wrap: on
line diff
--- a/plugins/mod_mam/mod_mam.lua	Tue Jul 18 12:38:16 2023 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Fri Jul 21 17:23:00 2023 +0200
@@ -441,7 +441,7 @@
 		local time = time_now();
 		local ok, err = archive:append(store_user, nil, clone_for_storage, time, with);
 		if not ok and err == "quota-limit" then
-			if type(cleanup_after) == "number" then
+			if cleanup_after ~= math.huge then
 				module:log("debug", "User '%s' over quota, cleaning archive", store_user);
 				local cleaned = archive:delete(store_user, {
 					["end"] = (os.time() - cleanup_after);
@@ -506,7 +506,7 @@
 	end
 end);
 
-if cleanup_after ~= "never" then
+if cleanup_after ~= math.huge then
 	local cleanup_storage = module:open_store("archive_cleanup");
 	local cleanup_map = module:open_store("archive_cleanup", "map");