mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +01:00
Add contextEventId
This commit is contained in:
parent
764e38f8c9
commit
06864a65b7
@ -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…
x
Reference in New Issue
Block a user