diff mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 6546:8a4e6421fd24

mod_storage_xmlarchive: Remove unnecessary percent-encoding of paths Paths from lfs.dir() are already in the percent-encoded form. Probably confusion left over since before 1b081c8fc1d9
author Kim Alvefur <zash@zash.se>
date Sun, 24 May 2026 19:17:22 +0200
parents 3b605bfc94aa
children
line wrap: on
line diff
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Sun May 24 19:15:11 2026 +0200
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Sun May 24 19:17:22 2026 +0200
@@ -457,13 +457,13 @@
 function provider:purge(username)
 	local encoded_username = dm.path_encode((username or "@") .. "@");
 	local basepath = prosody.paths.data .. "/" .. dm.path_encode(module.host);
-	for rawstore in lfs.dir(basepath) do
-		local encoded_store = basepath .. "/" .. dm.path_encode(rawstore);
-		if lfs.attributes(encoded_store, "mode") == "directory" then
-			for file in lfs.dir(encoded_store) do
+	for store in lfs.dir(basepath) do
+		local store_path = basepath .. "/" .. store;
+		if lfs.attributes(store_path, "mode") == "directory" then
+			for file in lfs.dir(store_path) do
 				if file:sub(1, #encoded_username) == encoded_username then
 					if file:sub(-4) == ".xml" or file:sub(-5) == ".list" or file:sub(-5) == ".lidx" then
-						os.remove(encoded_store .. "/" .. file);
+						os.remove(store_path .. "/" .. file);
 					end
 				end
 			end