plugins/mod_storage_memory.lua
changeset 10226 51f145094648
parent 10225 068692cb9e78
child 10843 018acdaf374f
--- a/plugins/mod_storage_memory.lua	Fri Aug 23 01:10:27 2019 +0200
+++ b/plugins/mod_storage_memory.lua	Fri Aug 23 01:15:44 2019 +0200
@@ -171,13 +171,18 @@
 	local iter, err = self:find(username, query)
 	if not iter then return iter, err; end
 	local counts = {};
+	local earliest = {};
 	local latest = {};
 	for _, _, when, with in iter do
 		counts[with] = (counts[with] or 0) + 1;
+		if earliest[with] == nil then
+			earliest[with] = when;
+		end
 		latest[with] = when;
 	end
 	return {
 		counts = counts;
+		earliest = earliest;
 		latest = latest;
 	};
 end