From 764e38f8c9ff23562e011571c53991a889dd9109 Mon Sep 17 00:00:00 2001
From: RMidhunSuresh <hi@midhun.dev>
Date: Tue, 7 Dec 2021 12:25:56 +0530
Subject: [PATCH] Use 'context' instead of 'related'

---
 src/matrix/room/timeline/Timeline.js           | 16 ++++++++--------
 src/matrix/room/timeline/entries/EventEntry.js | 10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js
index 352ba91d..2baa0c80 100644
--- a/src/matrix/room/timeline/Timeline.js
+++ b/src/matrix/room/timeline/Timeline.js
@@ -248,19 +248,19 @@ export class Timeline {
         const filteredEntries = entries.filter(e => !!e.relation);
         for (const entry of filteredEntries) {
             const id = entry.relatedEventId;
-            let relatedEvent;
+            let contextEvent;
             // find in remote events
-            relatedEvent = this.getByEventId(id);
+            contextEvent = this.getByEventId(id);
             // find in storage
-            if (!relatedEvent) {
-                relatedEvent = await this._fetchEventFromStorage(id);
+            if (!contextEvent) {
+                contextEvent = await this._fetchEventFromStorage(id);
             }
             // fetch from hs
-            if (!relatedEvent) {
-                relatedEvent = await this._fetchEventFromHomeserver(id);
+            if (!contextEvent) {
+                contextEvent = await this._fetchEventFromHomeserver(id);
             }
-            if (relatedEvent) {
-                entry.setRelatedEntry(relatedEvent);
+            if (contextEvent) {
+                entry.setContextEntry(contextEvent);
             }
         }
     }
diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js
index e626b02f..229c6940 100644
--- a/src/matrix/room/timeline/entries/EventEntry.js
+++ b/src/matrix/room/timeline/entries/EventEntry.js
@@ -24,7 +24,7 @@ export class EventEntry extends BaseEventEntry {
         this._eventEntry = eventEntry;
         this._decryptionError = null;
         this._decryptionResult = null;
-        this._relatedEntry = null;
+        this._contextEntry = null;
     }
 
     clone() {
@@ -42,8 +42,8 @@ export class EventEntry extends BaseEventEntry {
         }
     }
 
-    setRelatedEntry(entry) {
-        this._relatedEntry = entry;
+    setContextEntry(entry) {
+        this._contextEntry = entry;
     }
 
     get event() {
@@ -127,8 +127,8 @@ export class EventEntry extends BaseEventEntry {
         return getRelatedEventId(this.event);
     }
 
-    get relatedEntry() {
-        return this._relatedEntry;
+    get contextEntry() {
+        return this._contextEntry;
     }
 
     get isRedacted() {