From 11456106944b2381c16ed75bfa3cc2192899f9ed Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 26 Jun 2022 01:48:16 +0200 Subject: Fix timestamps after loading --- src/timeline/TimelineModel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/timeline/TimelineModel.cpp') diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index c7c1bfc5..3fe4c07f 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1055,6 +1055,10 @@ TimelineModel::updateLastMessage() ts, time}; if (description != lastMessage_) { + if (lastMessage_.timestamp == 0) { + cache::client()->updateLastMessageTimestamp(room_id_.toStdString(), + description.timestamp); + } lastMessage_ = description; emit lastMessageChanged(); } @@ -1068,6 +1072,10 @@ TimelineModel::updateLastMessage() QString::fromStdString(http::client()->user_id().to_string()), cache::displayName(room_id_, QString::fromStdString(mtx::accessors::sender(*event)))); if (description != lastMessage_) { + if (lastMessage_.timestamp == 0) { + cache::client()->updateLastMessageTimestamp(room_id_.toStdString(), + description.timestamp); + } lastMessage_ = description; emit lastMessageChanged(); } -- cgit 1.5.1