Mercurial > prosody-modules
comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 6508:3044e14fcaa0
mod_storage_xmlarchive: Fix compatibility with Lua 5.5
Loop variables became immutable in Lua 5.5, so shadow it by reassigning to it.
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Tue, 07 Apr 2026 06:51:05 +0200 |
| parents | 645de410dbca |
| children | f6c83a8425f2 |
comparison
equal
deleted
inserted
replaced
| 6507:73915ac32649 | 6508:3044e14fcaa0 |
|---|---|
| 456 | 456 |
| 457 function provider:purge(username) | 457 function provider:purge(username) |
| 458 local encoded_username = dm.path_encode((username or "@") .. "@"); | 458 local encoded_username = dm.path_encode((username or "@") .. "@"); |
| 459 local basepath = prosody.paths.data .. "/" .. dm.path_encode(module.host); | 459 local basepath = prosody.paths.data .. "/" .. dm.path_encode(module.host); |
| 460 for store in lfs.dir(basepath) do | 460 for store in lfs.dir(basepath) do |
| 461 store = basepath .. "/" .. dm.path_encode(store); | 461 local store = basepath .. "/" .. dm.path_encode(store); |
| 462 if lfs.attributes(store, "mode") == "directory" then | 462 if lfs.attributes(store, "mode") == "directory" then |
| 463 for file in lfs.dir(store) do | 463 for file in lfs.dir(store) do |
| 464 if file:sub(1, #encoded_username) == encoded_username then | 464 if file:sub(1, #encoded_username) == encoded_username then |
| 465 if file:sub(-4) == ".xml" or file:sub(-5) == ".list" then | 465 if file:sub(-4) == ".xml" or file:sub(-5) == ".list" then |
| 466 os.remove(store .. "/" .. file); | 466 os.remove(store .. "/" .. file); |
