Software /
code /
prosody-modules
Comparison
mod_storage_appendmap/mod_storage_appendmap.lua @ 2062:8f7083b980cf
mod_storage_appendmap: Fix keyvalue:set()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 06 Mar 2016 19:28:21 +0100 |
parent | 2061:b84284144e21 |
child | 2205:98354fbea63c |
comparison
equal
deleted
inserted
replaced
2061:b84284144e21 | 2062:8f7083b980cf |
---|---|
71 | 71 |
72 function keyval:get(user) | 72 function keyval:get(user) |
73 return map.get(self, user); | 73 return map.get(self, user); |
74 end | 74 end |
75 | 75 |
76 keyval.set = map.set_keys; | 76 function keyval:set(user, data) |
77 map.set(self, user); | |
78 if data then | |
79 for k, v in pairs(data) do | |
80 map.set(self, user, k, v); | |
81 end | |
82 end | |
83 return true; | |
84 end | |
77 | 85 |
78 -- TODO some kind of periodic compaction thing? | 86 -- TODO some kind of periodic compaction thing? |
79 function map:_compact(user) | 87 function map:_compact(user) |
80 local data = self:get(user); | 88 local data = self:get(user); |
81 return keyval.set(self, user, data); | 89 return keyval.set(self, user, data); |