Remove isLoadedFromStorage parameter

We don't really need this because we use context entries
This commit is contained in:
RMidhunSuresh 2023-05-17 16:15:00 +05:30
parent 626c3053d2
commit 1ef57b87da
2 changed files with 4 additions and 5 deletions

View File

@ -19,16 +19,15 @@ import {getPrevContentFromStateEvent, isRedacted} from "../../common";
import {getRelationFromContent, getRelatedEventId} from "../relations.js";
export class EventEntry extends BaseEventEntry {
constructor(eventEntry, fragmentIdComparer, isLoadedFromStorage = false) {
constructor(eventEntry, fragmentIdComparer) {
super(fragmentIdComparer);
this._eventEntry = eventEntry;
this._decryptionError = null;
this._decryptionResult = null;
this._isLoadedFromStorage = isLoadedFromStorage;
}
clone() {
const clone = new EventEntry(this._eventEntry, this._fragmentIdComparer, this._isLoadedFromStorage);
const clone = new EventEntry(this._eventEntry, this._fragmentIdComparer);
clone.updateFrom(this);
return clone;
}

View File

@ -54,7 +54,7 @@ async function readRawTimelineEntriesWithTxn(roomId, eventKey, direction, amount
} else {
eventsWithinFragment = await timelineStore.eventsBefore(roomId, eventKey, amount);
}
let eventEntries = eventsWithinFragment.map(e => new EventEntry(e, fragmentIdComparer, true));
let eventEntries = eventsWithinFragment.map(e => new EventEntry(e, fragmentIdComparer));
entries = directionalConcat(entries, eventEntries, direction);
// prepend or append eventsWithinFragment to entries, and wrap them in EventEntry
@ -140,7 +140,7 @@ export class TimelineReader {
const txn = await this._storage.readTxn(stores); // todo: can we just use this.readTxnStores here? probably
const storageEntry = await txn.timelineEvents.getByEventId(this._roomId, id);
if (storageEntry) {
const entry = new EventEntry(storageEntry, this._fragmentIdComparer, true);
const entry = new EventEntry(storageEntry, this._fragmentIdComparer);
if (this._decryptEntries) {
const request = this._decryptEntries([entry], txn, log);
await request.complete();