# HG changeset patch # User Kim Alvefur # Date 1432053248 -7200 # Node ID 54c8a0cb299637bf315b46bf444752a3a30e6d55 # Parent 3f3689a16133cf78c5ea1c64ad2df9496d8b63ee mod_storage_(archive-capable): Change order of arguments to :append to be the same as return values from :find iterator (see prosody 41725f3df3cc) diff -r 3f3689a16133 -r 54c8a0cb2996 mod_storage_gdbm/mod_storage_gdbm.lua --- a/mod_storage_gdbm/mod_storage_gdbm.lua Tue May 19 16:46:20 2015 +0200 +++ b/mod_storage_gdbm/mod_storage_gdbm.lua Tue May 19 18:34:08 2015 +0200 @@ -73,7 +73,11 @@ archive.get = keyval.get; archive.set = keyval.set; -function archive:append(username, key, when, with, value) +function archive:append(username, key, value, when, with) + if type(when) ~= "number" then + value, when, with = when, with, value; + end + key = key or uuid(); local meta = self:get(username); if not meta then diff -r 3f3689a16133 -r 54c8a0cb2996 mod_storage_memory/mod_storage_memory.lua --- a/mod_storage_memory/mod_storage_memory.lua Tue May 19 16:46:20 2015 +0200 +++ b/mod_storage_memory/mod_storage_memory.lua Tue May 19 18:34:08 2015 +0200 @@ -42,7 +42,10 @@ local archive_store = {}; archive_store.__index = archive_store; -function archive_store:append(username, key, when, with, value) +function archive_store:append(username, key, value, when, with) + if type(when) ~= "number" then + value, when, with = when, with, value; + end local a = self.store[username]; if not a then a = {}; @@ -116,7 +119,7 @@ i = old[i]; t = i.when; if not(qstart >= t and qend <= t and (not qwith or i.with == qwith)) then - self:append(username, i.key, t, i.with, i.value); + self:append(username, i.key, i.value, t, i.with); end end if #new == 0 then diff -r 3f3689a16133 -r 54c8a0cb2996 mod_storage_muc_log/mod_storage_muc_log.lua --- a/mod_storage_muc_log/mod_storage_muc_log.lua Tue May 19 16:46:20 2015 +0200 +++ b/mod_storage_muc_log/mod_storage_muc_log.lua Tue May 19 18:34:08 2015 +0200 @@ -48,7 +48,10 @@ return with and tag.name .. "<" .. with or tag.name; end -function driver:append(node, key, when, with, stanza) +function driver:append(node, key, stanza, when, with) + if type(when) ~= "number" then + value, when, with = when, with, value; + end local today = os_date(datef, when); local now = os_date(timef, when); local data = data_load(node, host, datastore .. "/" .. today) or {}; diff -r 3f3689a16133 -r 54c8a0cb2996 mod_storage_xmlarchive/mod_storage_xmlarchive.lua --- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Tue May 19 16:46:20 2015 +0200 +++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Tue May 19 18:34:08 2015 +0200 @@ -23,7 +23,10 @@ local archive = {}; local archive_mt = { __index = archive }; -function archive:append(username, _, when, with, data) +function archive:append(username, _, data, when, with) + if type(when) ~= "number" then + value, when, with = when, with, value; + end if getmetatable(data) ~= st.stanza_mt then module:log("error", "Attempt to store non-stanza object, traceback: %s", debug.traceback()); return nil, "unsupported-datatype";