Changeset

3651:95f7291db669

mod_map: Include timestamps of first/last message (if reported) Allows ordering conversations by recent activity or oldest unread.
author Kim Alvefur <zash@zash.se>
date Fri, 23 Aug 2019 01:16:58 +0200
parents 3650:30743ae1fe1a
children 3652:d0c2f001735f
files mod_map/mod_map.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_map/mod_map.lua	Fri Aug 23 01:08:12 2019 +0200
+++ b/mod_map/mod_map.lua	Fri Aug 23 01:16:58 2019 +0200
@@ -3,6 +3,7 @@
 local jid_bare = require "util.jid".bare;
 local rsm = require "util.rsm";
 local dataform = require "util.dataforms".new;
+local datetime = require "util.datetime".datetime;
 
 local archive = module:open_store("archive", "archive");
 
@@ -59,6 +60,12 @@
 		if type(count) == "number" then
 			reply:text_tag("count", ("%d"):format(count));
 		end
+		if summary.earliest and summary.earliest[jid] then
+			reply:text_tag("start", datetime(summary.earliest[jid]));
+		end
+		if summary.latest and summary.latest[jid] then
+			reply:text_tag("end", datetime(summary.latest[jid]));
+		end
 		reply:up();
 	end