forked from mystiq/hydrogen-web
Add contextEventId
This commit is contained in:
parent
764e38f8c9
commit
06864a65b7
2 changed files with 11 additions and 2 deletions
|
@ -245,9 +245,9 @@ export class Timeline {
|
|||
}
|
||||
|
||||
async _loadRelatedEvents(entries) {
|
||||
const filteredEntries = entries.filter(e => !!e.relation);
|
||||
const filteredEntries = entries.filter(e => !!e.contextEventId);
|
||||
for (const entry of filteredEntries) {
|
||||
const id = entry.relatedEventId;
|
||||
const id = entry.contextEventId;
|
||||
let contextEvent;
|
||||
// find in remote events
|
||||
contextEvent = this.getByEventId(id);
|
||||
|
|
|
@ -127,6 +127,15 @@ export class EventEntry extends BaseEventEntry {
|
|||
return getRelatedEventId(this.event);
|
||||
}
|
||||
|
||||
// return a related event-id only if this entry is a reply
|
||||
// excludes relations like redaction
|
||||
get contextEventId() {
|
||||
if (this.isReply) {
|
||||
return this.relatedEventId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
get contextEntry() {
|
||||
return this._contextEntry;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue