Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 3011:995836ee4f26
mod_http_upload: Add an experimental prosodyctl command for expiring uploads
prosodyctl mod_http_upload expire user@example.com [user2@example.com etc]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 19 May 2018 23:52:19 +0200 |
parents | faec53f4b31e |
children | d34f5d969940 |
comparison
equal
deleted
inserted
replaced
3010:7ee59f417c16 | 3011:995836ee4f26 |
---|---|
1 -- mod_http_upload | 1 -- mod_http_upload |
2 -- | 2 -- |
3 -- Copyright (C) 2015-2017 Kim Alvefur | 3 -- Copyright (C) 2015-2018 Kim Alvefur |
4 -- | 4 -- |
5 -- This file is MIT/X11 licensed. | 5 -- This file is MIT/X11 licensed. |
6 -- | 6 -- |
7 -- Implementation of HTTP Upload file transfer mechanism used by Conversations | 7 -- Implementation of HTTP Upload file transfer mechanism used by Conversations |
8 -- | 8 -- |
322 ["PUT /*"] = upload_data; | 322 ["PUT /*"] = upload_data; |
323 }; | 323 }; |
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 | |
328 function module.command(args) | |
329 if args[1] == "expire" then | |
330 local split = require "util.jid".prepped_split; | |
331 for i = 2, #args do | |
332 assert(expire(split(args[i]))); | |
333 end | |
334 end | |
335 end | |
336 |