Diff

mod_storage_memory/mod_storage_memory.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
parent 1608:59fdf4f12343
child 1760:e72f9eac51c8
line wrap: on
line diff
--- 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