comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 2038:a85b5c3791dc

mod_storage_xmlarchive: Collect return value when adding to date index
author Kim Alvefur <zash@zash.se>
date Tue, 02 Feb 2016 16:22:46 +0100
parents e63dba236a2a
children 459e1878d23c
comparison
equal deleted inserted replaced
2037:632aa9f49aed 2038:a85b5c3791dc
38 local id = day .. "-" .. hmac_sha256(username.."@"..day.."+"..offset, data, true):sub(-16); 38 local id = day .. "-" .. hmac_sha256(username.."@"..day.."+"..offset, data, true):sub(-16);
39 ok, err = dm.list_append(username.."@"..day, module.host, self.store, { id = id, when = dt.datetime(when), with = with, offset = offset, length = #data }); 39 ok, err = dm.list_append(username.."@"..day, module.host, self.store, { id = id, when = dt.datetime(when), with = with, offset = offset, length = #data });
40 if offset == 0 then 40 if offset == 0 then
41 -- means the message is at the beginnig of the file, so it's a new day 41 -- means the message is at the beginnig of the file, so it's a new day
42 -- so we add this new day to the "index" 42 -- so we add this new day to the "index"
43 dm.list_append(username, module.host, self.store, day); 43 ok, err = dm.list_append(username, module.host, self.store, day);
44 end 44 end
45 if not ok then 45 if not ok then
46 return nil, err; 46 return nil, err;
47 end 47 end
48 return id; 48 return id;