Adding last activity informations.

This commit is contained in:
John Livingston
2021-07-19 16:51:51 +02:00
parent b65d6ddde7
commit b64d9730d0
3 changed files with 30 additions and 2 deletions

View File

@ -36,12 +36,18 @@ local function list_rooms(event)
local rooms_json = array();
for room in all_rooms() do
local localpart = jid_split(room.jid);
local history = room._history;
local lasttimestamp;
if history ~= nil and #history > 0 then
lasttimestamp = history[#history].timestamp;
end
rooms_json:push({
jid = room.jid;
localpart = localpart;
name = room:get_name() or localpart;
lang = room.get_language and room:get_language();
description = room:get_description();
lasttimestamp = lasttimestamp;
})
end