diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index c9dfaf17..bc7f213a 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -125,7 +125,7 @@ export class Timeline { clock: this._clock, redactingEntry }); this._loadContextEntriesWhereNeeded([pee]); - this._applyAndEmitLocalRelationChange(pee, target => target.addRelation(pee)); + this._applyAndEmitLocalRelationChange(pee, target => target.addLocalRelation(pee)); return pee; } @@ -204,12 +204,12 @@ export class Timeline { if (pee.relatedEventId) { const relationTarget = entries.find(e => e.id === pee.relatedEventId); // no need to emit here as this entry is about to be added - relationTarget?.addRelation(pee); + relationTarget?.addLocalRelation(pee); } if (pee.redactingEntry) { const eventId = pee.redactingEntry.relatedEventId; const relationTarget = entries.find(e => e.id === eventId); - relationTarget?.addRelation(pee); + relationTarget?.addLocalRelation(pee); } } } @@ -275,7 +275,7 @@ export class Timeline { */ for (const entry of entries) { const relatedEntry = this._contextEntriesNotInTimeline.get(entry.relatedEventId); - if (relatedEntry?.isNonPersisted && relatedEntry?.addRelation(entry)) { + if (relatedEntry?.isNonPersisted && relatedEntry?.addLocalRelation(entry)) { // update other entries for which this entry is a context entry relatedEntry.contextForEntries?.forEach(e => { this._remoteEntries.findAndUpdate(te => te.id === e.id, () => "contextEntry"); diff --git a/src/matrix/room/timeline/entries/BaseEventEntry.js b/src/matrix/room/timeline/entries/BaseEventEntry.js index eeda4464..ec20f48a 100644 --- a/src/matrix/room/timeline/entries/BaseEventEntry.js +++ b/src/matrix/room/timeline/entries/BaseEventEntry.js @@ -81,7 +81,7 @@ export class BaseEventEntry extends BaseEntry { - to mark this entry as being redacted in Timeline._updateEntriesFetchedFromHomeserver @return [string] returns the name of the field that has changed, if any */ - addRelation(entry) { + addLocalRelation(entry) { if (entry.eventType === REDACTION_TYPE && entry.isRelatedToId(this.id)) { if (!this._pendingRedactions) { this._pendingRedactions = []; diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index 0d493825..247c1b21 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -180,7 +180,7 @@ export function tests() { function addPendingReaction(target, key) { queueIndex += 1; - target.addRelation(new PendingEventEntry({ + target.addLocalRelation(new PendingEventEntry({ pendingEvent: new PendingEvent({data: { eventType: "m.reaction", content: createAnnotation(target.id, key), @@ -202,7 +202,7 @@ export function tests() { }); } queueIndex += 1; - target.addRelation(new PendingEventEntry({ + target.addLocalRelation(new PendingEventEntry({ pendingEvent: new PendingEvent({data: { eventType: "m.room.redaction", relatedTxnId: pendingReaction ? pendingReaction.id : null, diff --git a/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js b/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js index 5d9ae4ca..7a8ed5d0 100644 --- a/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js +++ b/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js @@ -134,6 +134,6 @@ export class FragmentBoundaryEntry extends BaseEntry { return new FragmentBoundaryEntry(neighbour, !this._isFragmentStart, this._fragmentIdComparer); } - addRelation() {} + addLocalRelation() {} removeLocalRelation() {} }