Mercurial > prosody-hg
comparison util/datamanager.lua @ 6993:dc0c6b8dc638
util.datamanager: Overwrite 'data' variable instead of shadownig it [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 11 Dec 2015 20:11:48 +0100 |
| parents | 0622f2820d1d |
| children | 507301531cf5 |
comparison
equal
deleted
inserted
replaced
| 6992:0622f2820d1d | 6993:dc0c6b8dc638 |
|---|---|
| 232 local function list_append(username, host, datastore, data) | 232 local function list_append(username, host, datastore, data) |
| 233 if not data then return; end | 233 if not data then return; end |
| 234 if callback(username, host, datastore) == false then return true; end | 234 if callback(username, host, datastore) == false then return true; end |
| 235 -- save the datastore | 235 -- save the datastore |
| 236 | 236 |
| 237 local data = "item(" .. serialize(data) .. ");\n"; | 237 data = "item(" .. serialize(data) .. ");\n"; |
| 238 local ok, msg = append(username, host, datastore, "list", data); | 238 local ok, msg = append(username, host, datastore, "list", data); |
| 239 if not ok then | 239 if not ok then |
| 240 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); | 240 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); |
| 241 return ok, msg; | 241 return ok, msg; |
| 242 end | 242 end |
