From b00e624fb0a988d69175c0126f98c96a00b9244f Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 23 Apr 2020 15:28:46 +0200 Subject: [PATCH] Fix own messages not showing as encrypted --- src/timeline/TimelineModel.cpp | 14 +++++++------- 1 file 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 ids = internalAddEvents(timeline.events); - if (ids.empty()) - return; + if (!ids.empty()) { + beginInsertRows(QModelIndex(), 0, static_cast(ids.size() - 1)); + this->eventOrder.insert(this->eventOrder.begin(), ids.rbegin(), ids.rend()); + endInsertRows(); + } - beginInsertRows(QModelIndex(), 0, static_cast(ids.size() - 1)); - this->eventOrder.insert(this->eventOrder.begin(), ids.rbegin(), ids.rend()); - endInsertRows(); - - updateLastMessage(); + if (!timeline.events.empty()) + updateLastMessage(); } template