# HG changeset patch # User Kim Alvefur # Date 1551561990 -3600 # Node ID 9007ae90aeb1dbd728ac476e9f2c110555c77050 # Parent 789395f027f142faa6effc1fa49a4b21ae13fc74# Parent 40ed04014b9784c1f7cef60eab0c18686579f08e Merge 0.11->trunk diff -r 789395f027f1 -r 9007ae90aeb1 plugins/mod_storage_memory.lua --- 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