changeset 1760:e72f9eac51c8

mod_storage_(various): Order swapping in 54c8a0cb2996 was backwards
author Kim Alvefur <zash@zash.se>
date Thu, 21 May 2015 12:09:47 +0200
parents 0aeab7234d5e
children 6f34e51a23f0
files mod_storage_gdbm/mod_storage_gdbm.lua mod_storage_memory/mod_storage_memory.lua mod_storage_muc_log/mod_storage_muc_log.lua mod_storage_xmlarchive/mod_storage_xmlarchive.lua
diffstat 4 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_gdbm/mod_storage_gdbm.lua	Thu May 21 11:56:35 2015 +0200
+++ b/mod_storage_gdbm/mod_storage_gdbm.lua	Thu May 21 12:09:47 2015 +0200
@@ -75,7 +75,7 @@
 
 function archive:append(username, key, value, when, with)
 	if type(when) ~= "number" then
-		value, when, with = when, with, value;
+		when, with, value = value, when, with;
 	end
 
 	key = key or uuid();
--- a/mod_storage_memory/mod_storage_memory.lua	Thu May 21 11:56:35 2015 +0200
+++ b/mod_storage_memory/mod_storage_memory.lua	Thu May 21 12:09:47 2015 +0200
@@ -44,7 +44,7 @@
 
 function archive_store:append(username, key, value, when, with)
 	if type(when) ~= "number" then
-		value, when, with = when, with, value;
+		when, with, value = value, when, with;
 	end
 	local a = self.store[username];
 	if not a then
--- a/mod_storage_muc_log/mod_storage_muc_log.lua	Thu May 21 11:56:35 2015 +0200
+++ b/mod_storage_muc_log/mod_storage_muc_log.lua	Thu May 21 12:09:47 2015 +0200
@@ -50,7 +50,7 @@
 
 function driver:append(node, key, stanza, when, with)
 	if type(when) ~= "number" then
-		stanza, when, with = when, with, stanza;
+		when, with, stanza = stanza, when, with;
 	end
 	local today = os_date(datef, when);
 	local now = os_date(timef, when);
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Thu May 21 11:56:35 2015 +0200
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Thu May 21 12:09:47 2015 +0200
@@ -23,9 +23,10 @@
 local archive = {};
 local archive_mt = { __index = archive };
 
+local s = require"util.serialization".new("debug").serialize;
 function archive:append(username, _, data, when, with)
 	if type(when) ~= "number" then
-		data, when, with = when, with, data;
+		when, with, data = data, when, with;
 	end
 	if getmetatable(data) ~= st.stanza_mt then
 		module:log("error", "Attempt to store non-stanza object, traceback: %s", debug.traceback());