Changeset

2171:85d88ed4f2a2

mod_storage_memory: Implement 'add_keys' method of map stores (required for rosters in 0.10+)
author Kim Alvefur <zash@zash.se>
date Sat, 07 May 2016 13:37:03 +0200
parents 2170:4652a112a4ba
children 2172:a347b71adb07
files mod_storage_memory/mod_storage_memory.lua
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_memory/mod_storage_memory.lua	Thu May 05 15:43:01 2016 +0200
+++ b/mod_storage_memory/mod_storage_memory.lua	Sat May 07 13:37:03 2016 +0200
@@ -41,6 +41,20 @@
 	return true;
 end
 
+map_store.remove = {};
+function map_store:set_keys(username, keydatas)
+	local userstore = self.store[username or NULL];
+	if userstore == nil then
+		userstore = {};
+		self.store[username or NULL] = userstore;
+	end
+	for k,v in pairs(keydatas) do
+		if v == self.remove then v = nil; end
+		current[k] = v;
+	end
+	return true;
+end
+
 local archive_store = {};
 archive_store.__index = archive_store;