Software /
code /
prosody-modules
Changeset
2472:595d6a25bd7a
mod_http_upload: Record upload slot metadata (fixes #718)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 29 Jan 2017 17:27:49 +0100 |
parents | 2471:f48e9e25aec4 |
children | 2473:fa8fe2ab332f |
files | mod_http_upload/mod_http_upload.lua |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua Sun Jan 29 17:27:24 2017 +0100 +++ b/mod_http_upload/mod_http_upload.lua Sun Jan 29 17:27:49 2017 +0100 @@ -13,6 +13,7 @@ local random_hex = require"util.uuid".get_nibbles; local url = require "socket.url"; local dataform = require "util.dataforms".new; +local datamanager = require "util.datamanager"; local t_concat = table.concat; local t_insert = table.insert; local s_upper = string.upper; @@ -89,6 +90,7 @@ repeat random = random_hex(12); until lfs.mkdir(join_path(storage_path, random)) or not lfs.attributes(join_path(storage_path, random, filename)) + datamanager.list_apppend(origin.username, origin.host, module.name, { filename = join_path(storage_path, random, filename), size = filesize, time = os.time() }); pending_slots[random.."/"..filename] = origin.full_jid; local base_url = module:http_url(); local slot_url = url.parse(base_url);