aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-02 22:26:01 +0100
committerKim Alvefur <zash@zash.se>2019-03-02 22:26:01 +0100
commit258089ed26984350e8981492b30409429e16605b (patch)
tree3c68eee6c39065b80b75ce7f4024a8b3824ce426 /plugins
parenteb01e60ec3af33bb8ed82d17f3240a1b5a5bcbae (diff)
downloadprosody-258089ed26984350e8981492b30409429e16605b.tar.gz
prosody-258089ed26984350e8981492b30409429e16605b.zip
mod_storage_memory: Generate ID using standard util (fixes #1326)
The previous method relied on tostring(table) returning the pointer address, which might not be portable.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_memory.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_storage_memory.lua b/plugins/mod_storage_memory.lua
index 1c6628e3..71205ee0 100644
--- a/plugins/mod_storage_memory.lua
+++ b/plugins/mod_storage_memory.lua
@@ -3,6 +3,7 @@ local array = require "util.array";
local envload = require "util.envload".envload;
local st = require "util.stanza";
local is_stanza = st.is_stanza or function (s) return getmetatable(s) == st.stanza_mt end
+local new_id = require "util.id".medium;
local auto_purge_enabled = module:get_option_boolean("storage_memory_temporary", false);
local auto_purge_stores = module:get_option_set("storage_memory_temporary_stores", {});
@@ -56,7 +57,7 @@ function archive_store:append(username, key, value, when, with)
end
local v = { key = key, when = when, with = with, value = value };
if not key then
- key = tostring(a):match"%x+$"..tostring(v):match"%x+$";
+ key = new_id();
v.key = key;
end
if a[key] then