From f014ba0feb218c5131e68cd14cafb1feb3e8d7ad Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Nov 2018 20:30:21 +0100 Subject: mod_storage_memory: Support the purge driver method --- plugins/mod_storage_memory.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_storage_memory.lua b/plugins/mod_storage_memory.lua index 9659f9e7..ed04a5fb 100644 --- a/plugins/mod_storage_memory.lua +++ b/plugins/mod_storage_memory.lua @@ -197,6 +197,12 @@ function driver:open(store, typ) -- luacheck: ignore 212/self return nil, "unsupported-store"; end +function driver:purge(user) -- luacheck: ignore 212/self + for _, store in pairs(memory) do + store[user] = nil; + end +end + if auto_purge_enabled then module:hook("resource-unbind", function (event) local user_bare_jid = event.session.username.."@"..event.session.host; -- cgit v1.2.3