Software /
code /
prosody-modules
Changeset
2479:a440f0514c2a
Backed out changeset f48e9e25aec4, util.uuid.get_nibbles is unavailable in 0.9
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 31 Jan 2017 14:05:53 +0100 |
parents | 2478:1fae2a0a4092 |
children | 2480:c98b37d6d86c |
files | mod_http_upload/mod_http_upload.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua Sun Jan 29 19:27:27 2017 +0100 +++ b/mod_http_upload/mod_http_upload.lua Tue Jan 31 14:05:53 2017 +0100 @@ -10,7 +10,7 @@ -- imports local st = require"util.stanza"; local lfs = require"lfs"; -local random_hex = require"util.uuid".get_nibbles; +local uuid = require"util.uuid".generate; local url = require "socket.url"; local dataform = require "util.dataforms".new; local datamanager = require "util.datamanager"; @@ -87,7 +87,7 @@ reply:tag("slot", { xmlns = xmlns_http_upload }); local random; - repeat random = random_hex(12); + repeat random = uuid(); until lfs.mkdir(join_path(storage_path, random)) or not lfs.attributes(join_path(storage_path, random, filename)) datamanager.list_append(origin.username, origin.host, module.name, { filename = join_path(storage_path, random, filename), size = filesize, time = os.time() });