Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 3339:babb584e24a2
mod_http_upload: Run expiry for all users if command run with a hostname
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 27 Sep 2018 19:54:26 +0200 |
parents | d34f5d969940 |
children | 6081cbfd1220 |
comparison
equal
deleted
inserted
replaced
3338:7d2400710d65 | 3339:babb584e24a2 |
---|---|
324 }); | 324 }); |
325 | 325 |
326 module:log("info", "URL: <%s>; Storage path: %s", module:http_url(), storage_path); | 326 module:log("info", "URL: <%s>; Storage path: %s", module:http_url(), storage_path); |
327 | 327 |
328 function module.command(args) | 328 function module.command(args) |
329 -- luacheck: ignore 421/user | |
329 if args[1] == "expire" then | 330 if args[1] == "expire" then |
330 local split = require "util.jid".prepped_split; | 331 local split = require "util.jid".prepped_split; |
331 for i = 2, #args do | 332 for i = 2, #args do |
332 assert(expire(split(args[i]))); | 333 local user, host = split(args[i]); |
334 if user then | |
335 assert(expire(user, host)); | |
336 else | |
337 for user in datamanager.users(host, module.name, "list") do | |
338 expire(user, host); | |
339 end | |
340 end | |
333 end | 341 end |
334 end | 342 end |
335 end | 343 end |
336 | 344 |