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 |