# HG changeset patch # User Kim Alvefur # Date 1566515818 -7200 # Node ID 95f7291db669fca9dc130890b08aaeacf4f0e43b # Parent 30743ae1fe1a4ca5093e1c6f2de0213b493578ed mod_map: Include timestamps of first/last message (if reported) Allows ordering conversations by recent activity or oldest unread. diff -r 30743ae1fe1a -r 95f7291db669 mod_map/mod_map.lua --- 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