# HG changeset patch # User Kim Alvefur # Date 1488653561 -3600 # Node ID 307ddebb72e123cc97b463e0f92e9ec51ac5909c # Parent 1e1c929c1aa5235d8ae162e6e9777d9f75a58b1f mod_storage_xmlarchive: Assume offset to be zero if not included (thanks pep.) diff -r 1e1c929c1aa5 -r 307ddebb72e1 mod_storage_xmlarchive/mod_storage_xmlarchive.lua --- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Mar 03 12:31:15 2017 +0000 +++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Sat Mar 04 19:52:41 2017 +0100 @@ -45,7 +45,7 @@ -- If the day-file is missing then we need to add it to the list of days local first_of_day = not lfs.attributes(dm.getpath(username .. "@" .. day, module.host, self.store, "list")); - local offset = ok and err; + local offset = ok and err or 0; local id = day .. "-" .. hmac_sha256(username.."@"..day.."+"..offset, data, true):sub(-16); ok, err = dm.list_append(username.."@"..day, module.host, self.store, { id = id, when = dt.datetime(when), with = with, offset = offset, length = #data });