Mercurial > prosody-hg
diff plugins/mod_storage_memory.lua @ 9609:1dfcea523200 0.11
mod_storage_memory: Support the purge driver method
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 07 Nov 2018 20:30:21 +0100 |
| parents | c1befd1c886d |
| children | 4c91afc43639 96d9c121547b |
line wrap: on
line diff
--- a/plugins/mod_storage_memory.lua Wed Nov 07 17:49:34 2018 +0100 +++ b/plugins/mod_storage_memory.lua Wed Nov 07 20:30:21 2018 +0100 @@ -197,6 +197,12 @@ 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;
