summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
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/TimelineModel.cpp
parentAdd an option to define new power levels (diff)
downloadnheko-11456106944b2381c16ed75bfa3cc2192899f9ed.tar.xz
Fix timestamps after loading
Diffstat (limited to '')
-rw-r--r--src/timeline/TimelineModel.cpp8
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();
         }