summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-20 14:09:19 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-20 14:09:19 +0200
commit88ed0fade74915e83df3a8e335d7cc49ee068d5c (patch)
tree32be533662aae46c0320725d3d9af8a10ef62eda /src/timeline
parentFix reaction button again (diff)
downloadnheko-88ed0fade74915e83df3a8e335d7cc49ee068d5c.tar.xz
Explicitly reload data in delegates, if related events got loaded
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineModel.cpp4
-rw-r--r--src/timeline/TimelineModel.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index abfe28a9..7b3f0729 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -344,6 +344,7 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
           &EventStore::dataChanged,
           this,
           [this](int from, int to) {
+                  relatedEventCacheBuster++;
                   nhlog::ui()->debug(
                     "data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
                   emit dataChanged(index(events.size() - to - 1, 0),
@@ -443,6 +444,7 @@ TimelineModel::roleNames() const
           {RoomTopic, "roomTopic"},
           {CallType, "callType"},
           {Dump, "dump"},
+          {RelatedEventCacheBuster, "relatedEventCacheBuster"},
         };
 }
 int
@@ -676,6 +678,8 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
 
                 return QVariant(m);
         }
+        case RelatedEventCacheBuster:
+                return relatedEventCacheBuster;
         default:
                 return QVariant();
         }
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 0e2895d4..3c80ade8 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -208,6 +208,7 @@ public:
                 RoomTopic,
                 CallType,
                 Dump,
+                RelatedEventCacheBuster,
         };
         Q_ENUM(Roles);
 
@@ -400,6 +401,8 @@ private:
 
         int notification_count = 0, highlight_count = 0;
 
+        unsigned int relatedEventCacheBuster = 0;
+
         bool decryptDescription     = true;
         bool m_paginationInProgress = false;
         bool isSpace_               = false;