Restore earlier name

This commit is contained in:
RMidhunSuresh 2022-01-12 19:20:32 +05:30
parent ed88184757
commit 2f4c0623d0
4 changed files with 8 additions and 8 deletions

View file

@ -125,7 +125,7 @@ export class Timeline {
clock: this._clock, redactingEntry clock: this._clock, redactingEntry
}); });
this._loadContextEntriesWhereNeeded([pee]); this._loadContextEntriesWhereNeeded([pee]);
this._applyAndEmitLocalRelationChange(pee, target => target.addRelation(pee)); this._applyAndEmitLocalRelationChange(pee, target => target.addLocalRelation(pee));
return pee; return pee;
} }
@ -204,12 +204,12 @@ export class Timeline {
if (pee.relatedEventId) { if (pee.relatedEventId) {
const relationTarget = entries.find(e => e.id === pee.relatedEventId); const relationTarget = entries.find(e => e.id === pee.relatedEventId);
// no need to emit here as this entry is about to be added // no need to emit here as this entry is about to be added
relationTarget?.addRelation(pee); relationTarget?.addLocalRelation(pee);
} }
if (pee.redactingEntry) { if (pee.redactingEntry) {
const eventId = pee.redactingEntry.relatedEventId; const eventId = pee.redactingEntry.relatedEventId;
const relationTarget = entries.find(e => e.id === eventId); 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) { for (const entry of entries) {
const relatedEntry = this._contextEntriesNotInTimeline.get(entry.relatedEventId); 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 // update other entries for which this entry is a context entry
relatedEntry.contextForEntries?.forEach(e => { relatedEntry.contextForEntries?.forEach(e => {
this._remoteEntries.findAndUpdate(te => te.id === e.id, () => "contextEntry"); this._remoteEntries.findAndUpdate(te => te.id === e.id, () => "contextEntry");

View file

@ -81,7 +81,7 @@ export class BaseEventEntry extends BaseEntry {
- to mark this entry as being redacted in Timeline._updateEntriesFetchedFromHomeserver - to mark this entry as being redacted in Timeline._updateEntriesFetchedFromHomeserver
@return [string] returns the name of the field that has changed, if any @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 (entry.eventType === REDACTION_TYPE && entry.isRelatedToId(this.id)) {
if (!this._pendingRedactions) { if (!this._pendingRedactions) {
this._pendingRedactions = []; this._pendingRedactions = [];

View file

@ -180,7 +180,7 @@ export function tests() {
function addPendingReaction(target, key) { function addPendingReaction(target, key) {
queueIndex += 1; queueIndex += 1;
target.addRelation(new PendingEventEntry({ target.addLocalRelation(new PendingEventEntry({
pendingEvent: new PendingEvent({data: { pendingEvent: new PendingEvent({data: {
eventType: "m.reaction", eventType: "m.reaction",
content: createAnnotation(target.id, key), content: createAnnotation(target.id, key),
@ -202,7 +202,7 @@ export function tests() {
}); });
} }
queueIndex += 1; queueIndex += 1;
target.addRelation(new PendingEventEntry({ target.addLocalRelation(new PendingEventEntry({
pendingEvent: new PendingEvent({data: { pendingEvent: new PendingEvent({data: {
eventType: "m.room.redaction", eventType: "m.room.redaction",
relatedTxnId: pendingReaction ? pendingReaction.id : null, relatedTxnId: pendingReaction ? pendingReaction.id : null,

View file

@ -134,6 +134,6 @@ export class FragmentBoundaryEntry extends BaseEntry {
return new FragmentBoundaryEntry(neighbour, !this._isFragmentStart, this._fragmentIdComparer); return new FragmentBoundaryEntry(neighbour, !this._isFragmentStart, this._fragmentIdComparer);
} }
addRelation() {} addLocalRelation() {}
removeLocalRelation() {} removeLocalRelation() {}
} }