1 files changed, 7 insertions, 3 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index e17c1c59..cb9fb7fa 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -1264,10 +1264,14 @@ TimelineModel::readEvent(const std::string &id)
http::client()->read_event(
room_id_.toStdString(),
id,
- [this](mtx::http::RequestErr err) {
+ [this, newId = id, oldId = currentReadId](mtx::http::RequestErr err) {
if (err) {
- nhlog::net()->warn(
- "failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString());
+ nhlog::net()->warn("failed to read_event ({}, {})", room_id_.toStdString(), newId);
+
+ ChatPage::instance()->callFunctionOnGuiThread([this, newId, oldId] {
+ if (currentReadId.toStdString() == newId)
+ this->currentReadId = oldId;
+ });
}
},
!UserSettings::instance()->readReceipts());
|