Diff

mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 2595:307ddebb72e1

mod_storage_xmlarchive: Assume offset to be zero if not included (thanks pep.)
author Kim Alvefur <zash@zash.se>
date Sat, 04 Mar 2017 19:52:41 +0100
parent 2514:d47a7e6e9adc
child 2600:9ec8289f6bb2
line wrap: on
line diff
--- 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 });