diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-06-26 01:48:16 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-06-26 01:48:16 +0200 |
commit | 11456106944b2381c16ed75bfa3cc2192899f9ed (patch) | |
tree | 1481f97fac9fe1456f1fc4faa02b787926875e9e /src/timeline/TimelineModel.cpp | |
parent | Add an option to define new power levels (diff) | |
download | nheko-11456106944b2381c16ed75bfa3cc2192899f9ed.tar.xz |
Fix timestamps after loading
Diffstat (limited to '')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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(); } |