mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Use 'context' instead of 'related'
This commit is contained in:
parent
696980aca4
commit
764e38f8c9
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user