diff options
author | Kim Alvefur <zash@zash.se> | 2016-02-10 07:57:58 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-02-10 07:57:58 +0100 |
commit | ca7a512e35b8522ada592f14ac375329ab786a30 (patch) | |
tree | c39d1e6bfacafa23202f13f21ec1da1a44b2f2b4 /core/storagemanager.lua | |
parent | bee4aa35ce6c7da81c5c563ef5b08d8188af8451 (diff) | |
parent | f856a201b70f1cbacb1d9715d44a6ab442a7fa06 (diff) | |
download | prosody-ca7a512e35b8522ada592f14ac375329ab786a30.tar.gz prosody-ca7a512e35b8522ada592f14ac375329ab786a30.zip |
Merge 0.10->trunk
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r-- | core/storagemanager.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua index 33fd5d49..de68c2ac 100644 --- a/core/storagemanager.lua +++ b/core/storagemanager.lua @@ -118,6 +118,23 @@ local map_shim_mt = { current[key] = data; return self.keyval_store:set(username, current); end; + set_keys = function (self, username, keydatas) + local current, err = self.keyval_store:get(username); + if current == nil then + if err then + return nil, err; + else + current = keydatas; + end + else + for k,v in pairs(keydatas) do + if v == self.remove then v = nil; end + current[k] = v; + end + end + return self.keyval_store:set(username, current); + end; + remove = {}; }; } |