Mercurial > prosody-modules
comparison mod_storage_muc_log/mod_storage_muc_log.lua @ 1753:54c8a0cb2996
mod_storage_(archive-capable): Change order of arguments to :append to be the same as return values from :find iterator (see prosody 41725f3df3cc)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 19 May 2015 18:34:08 +0200 |
parents | 711fabfe6604 |
children | 0aeab7234d5e |
comparison
equal
deleted
inserted
replaced
1752:3f3689a16133 | 1753:54c8a0cb2996 |
---|---|
46 local function st_with(tag) | 46 local function st_with(tag) |
47 local with = tag.attr.type; | 47 local with = tag.attr.type; |
48 return with and tag.name .. "<" .. with or tag.name; | 48 return with and tag.name .. "<" .. with or tag.name; |
49 end | 49 end |
50 | 50 |
51 function driver:append(node, key, when, with, stanza) | 51 function driver:append(node, key, stanza, when, with) |
52 if type(when) ~= "number" then | |
53 value, when, with = when, with, value; | |
54 end | |
52 local today = os_date(datef, when); | 55 local today = os_date(datef, when); |
53 local now = os_date(timef, when); | 56 local now = os_date(timef, when); |
54 local data = data_load(node, host, datastore .. "/" .. today) or {}; | 57 local data = data_load(node, host, datastore .. "/" .. today) or {}; |
55 data[#data + 1] = "<stanza time=\"".. now .. "\">" .. tostring(stanza) .. "</stanza>\n"; | 58 data[#data + 1] = "<stanza time=\"".. now .. "\">" .. tostring(stanza) .. "</stanza>\n"; |
56 datamanager.getpath(node, host, datastore, nil, true); -- create the datastore dir | 59 datamanager.getpath(node, host, datastore, nil, true); -- create the datastore dir |