summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-23 15:28:46 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-23 15:28:46 +0200
commitb00e624fb0a988d69175c0126f98c96a00b9244f (patch)
tree9339a8c89ae28cadf70dde861f936defd7fce037 /src/timeline/TimelineModel.cpp
parentFix encrypted messages not showing a user in the sidebar (diff)
downloadnheko-b00e624fb0a988d69175c0126f98c96a00b9244f.tar.xz
Fix own messages not showing as encrypted
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 3e2c32fa..ff1f324e 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -477,14 +477,14 @@ TimelineModel::addEvents(const mtx::responses::Timeline &timeline)
 
         std::vector<QString> ids = internalAddEvents(timeline.events);
 
-        if (ids.empty())
-                return;
-
-        beginInsertRows(QModelIndex(), 0, static_cast<int>(ids.size() - 1));
-        this->eventOrder.insert(this->eventOrder.begin(), ids.rbegin(), ids.rend());
-        endInsertRows();
+        if (!ids.empty()) {
+                beginInsertRows(QModelIndex(), 0, static_cast<int>(ids.size() - 1));
+                this->eventOrder.insert(this->eventOrder.begin(), ids.rbegin(), ids.rend());
+                endInsertRows();
+        }
 
-        updateLastMessage();
+        if (!timeline.events.empty())
+                updateLastMessage();
 }
 
 template<typename T>