Diff

plugins/mod_storage_memory.lua @ 9881:68faa0c1a99c 0.11

mod_storage_memory: Implement :user iteration API
author Kim Alvefur <zash@zash.se>
date Mon, 14 Jan 2019 00:17:02 +0100
parent 9838:40ed04014b97
child 9882:18f025b3987d
line wrap: on
line diff
--- a/plugins/mod_storage_memory.lua	Fri Mar 22 17:40:07 2019 +0100
+++ b/plugins/mod_storage_memory.lua	Mon Jan 14 00:17:02 2019 +0100
@@ -23,6 +23,10 @@
 	return true;
 end
 
+local function _users(self)
+	return next, self.store, nil;
+end
+
 local keyval_store = {};
 keyval_store.__index = keyval_store;
 
@@ -40,9 +44,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);