Mercurial > prosody-modules
changeset 4647:b91e40472d68
mod_storage_xmlarchive: Fix return of numeric 'when' from key-value API
At some point, 'when' was stored as a timestamp string then as a numeric
UNIX timestamp, so both cases needs to be handled, as they are
elsewhere.
Thanks spec/core_storagemanager_spec.lua
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 13 Aug 2021 01:37:15 +0200 |
parents | 072d078be095 |
children | 37ca6109077f |
files | mod_storage_xmlarchive/mod_storage_xmlarchive.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Aug 13 01:18:32 2021 +0200 +++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Aug 13 01:37:15 2021 +0200 @@ -1,5 +1,5 @@ -- mod_storage_xmlarchive --- Copyright (C) 2015-2020 Kim Alvefur +-- Copyright (C) 2015-2021 Kim Alvefur -- -- This file is MIT/X11 licensed. -- @@ -84,7 +84,7 @@ local data = xmlfile:read(item.length); local parsed, perr = xml.parse(data); if not parsed then return nil, perr; end - return parsed, dt.parse(item.when), item.with; + return parsed, tonumber(item.when) or dt.parse(item.when), item.with; end local overwrite = module:get_option("xmlarchive_overwrite", false);