Use 'context' instead of 'related'

This commit is contained in:
RMidhunSuresh 2021-12-07 12:25:56 +05:30
parent 696980aca4
commit 764e38f8c9
2 changed files with 13 additions and 13 deletions

View File

@ -248,19 +248,19 @@ export class Timeline {
const filteredEntries = entries.filter(e => !!e.relation); const filteredEntries = entries.filter(e => !!e.relation);
for (const entry of filteredEntries) { for (const entry of filteredEntries) {
const id = entry.relatedEventId; const id = entry.relatedEventId;
let relatedEvent; let contextEvent;
// find in remote events // find in remote events
relatedEvent = this.getByEventId(id); contextEvent = this.getByEventId(id);
// find in storage // find in storage
if (!relatedEvent) { if (!contextEvent) {
relatedEvent = await this._fetchEventFromStorage(id); contextEvent = await this._fetchEventFromStorage(id);
} }
// fetch from hs // fetch from hs
if (!relatedEvent) { if (!contextEvent) {
relatedEvent = await this._fetchEventFromHomeserver(id); contextEvent = await this._fetchEventFromHomeserver(id);
} }
if (relatedEvent) { if (contextEvent) {
entry.setRelatedEntry(relatedEvent); entry.setContextEntry(contextEvent);
} }
} }
} }

View File

@ -24,7 +24,7 @@ export class EventEntry extends BaseEventEntry {
this._eventEntry = eventEntry; this._eventEntry = eventEntry;
this._decryptionError = null; this._decryptionError = null;
this._decryptionResult = null; this._decryptionResult = null;
this._relatedEntry = null; this._contextEntry = null;
} }
clone() { clone() {
@ -42,8 +42,8 @@ export class EventEntry extends BaseEventEntry {
} }
} }
setRelatedEntry(entry) { setContextEntry(entry) {
this._relatedEntry = entry; this._contextEntry = entry;
} }
get event() { get event() {
@ -127,8 +127,8 @@ export class EventEntry extends BaseEventEntry {
return getRelatedEventId(this.event); return getRelatedEventId(this.event);
} }
get relatedEntry() { get contextEntry() {
return this._relatedEntry; return this._contextEntry;
} }
get isRedacted() { get isRedacted() {