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 | c86ef31dfa4823aa9791f5b253acc4654c69d0f8 (patch) | |
tree | c39d1e6bfacafa23202f13f21ec1da1a44b2f2b4 /core/storagemanager.lua | |
parent | 6ce49ff96e6fa51a50524ab7d07abffd121fdf89 (diff) | |
parent | bb71bd86fa1c64fa83aa309e006556ccf0e751b6 (diff) | |
download | prosody-c86ef31dfa4823aa9791f5b253acc4654c69d0f8.tar.gz prosody-c86ef31dfa4823aa9791f5b253acc4654c69d0f8.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 = {}; }; } |