Software /
code /
prosody
Diff
plugins/mod_storage_memory.lua @ 9783:4c91afc43639
mod_storage_memory: Implement :user iteration API
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 14 Jan 2019 00:17:02 +0100 |
parent | 9609:1dfcea523200 |
child | 9834:a657df70cc31 |
line wrap: on
line diff
--- a/plugins/mod_storage_memory.lua Thu Jan 10 15:25:38 2019 +0100 +++ b/plugins/mod_storage_memory.lua Mon Jan 14 00:17:02 2019 +0100 @@ -22,6 +22,10 @@ return true; end +local function _users(self) + return next, self.store, nil; +end + local keyval_store = {}; keyval_store.__index = keyval_store; @@ -39,9 +43,13 @@ keyval_store.purge = _purge_store; +keyval_store.users = _users; + local archive_store = {}; archive_store.__index = archive_store; +archive_store.users = _users; + function archive_store:append(username, key, value, when, with) if is_stanza(value) then value = st.preserialize(value);