summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-06-26 01:48:16 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-06-26 01:48:16 +0200
commit11456106944b2381c16ed75bfa3cc2192899f9ed (patch)
tree1481f97fac9fe1456f1fc4faa02b787926875e9e /src/timeline
parentAdd an option to define new power levels (diff)
downloadnheko-11456106944b2381c16ed75bfa3cc2192899f9ed.tar.xz
Fix timestamps after loading
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/RoomlistModel.cpp1
-rw-r--r--src/timeline/TimelineModel.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp

index bb2644f3..1cf16243 100644 --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp
@@ -298,6 +298,7 @@ RoomlistModel::addRoom(const QString &room_id, bool suppressInsertNotification) { Roles::HasLoudNotification, Roles::LastMessage, + Roles::Time, Roles::Timestamp, Roles::NotificationCount, Qt::DisplayRole, 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(); }