Software /
code /
prosody
Comparison
core/storagemanager.lua @ 7245:210d8329dc70
Merge trunk->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 06 Mar 2016 18:52:22 +0100 |
parent | 7157:0890a428a99b |
parent | 7244:8c6943918279 |
child | 7327:d62f0471470f |
comparison
equal
deleted
inserted
replaced
7243:6e6eea2124c5 | 7245:210d8329dc70 |
---|---|
121 set_keys = function (self, username, keydatas) | 121 set_keys = function (self, username, keydatas) |
122 local current, err = self.keyval_store:get(username); | 122 local current, err = self.keyval_store:get(username); |
123 if current == nil then | 123 if current == nil then |
124 if err then | 124 if err then |
125 return nil, err; | 125 return nil, err; |
126 else | |
127 current = keydatas; | |
128 end | 126 end |
129 else | 127 current = {}; |
130 for k,v in pairs(keydatas) do | 128 end |
131 if v == self.remove then v = nil; end | 129 for k,v in pairs(keydatas) do |
132 current[k] = v; | 130 if v == self.remove then v = nil; end |
133 end | 131 current[k] = v; |
134 end | 132 end |
135 return self.keyval_store:set(username, current); | 133 return self.keyval_store:set(username, current); |
136 end; | 134 end; |
137 remove = {}; | 135 remove = {}; |
138 }; | 136 }; |