plugins/mod_storage_memory.lua
changeset 9843 9007ae90aeb1
parent 9838 a657df70cc31
parent 9842 40ed04014b97
child 9886 18f025b3987d
--- a/plugins/mod_storage_memory.lua	Wed Oct 10 17:22:08 2018 +0200
+++ b/plugins/mod_storage_memory.lua	Sat Mar 02 22:26:30 2019 +0100
@@ -3,6 +3,7 @@
 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", {});
@@ -64,7 +65,7 @@
 	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