some tabs in here

This commit is contained in:
Bruno Windels 2020-09-23 18:22:51 +02:00
parent 64f657e5a2
commit 7cad3b2bdb

View File

@ -34,15 +34,15 @@ import {DecryptionSource} from "../e2ee/common.js";
const EVENT_ENCRYPTED_TYPE = "m.room.encrypted";
export class Room extends EventEmitter {
constructor({roomId, storage, hsApi, mediaRepository, emitCollectionChange, pendingEvents, user, createRoomEncryption, getSyncToken, clock}) {
constructor({roomId, storage, hsApi, mediaRepository, emitCollectionChange, pendingEvents, user, createRoomEncryption, getSyncToken, clock}) {
super();
this._roomId = roomId;
this._storage = storage;
this._hsApi = hsApi;
this._mediaRepository = mediaRepository;
this._summary = new RoomSummary(roomId);
this._summary = new RoomSummary(roomId);
this._fragmentIdComparer = new FragmentIdComparer([]);
this._syncWriter = new SyncWriter({roomId, fragmentIdComparer: this._fragmentIdComparer});
this._syncWriter = new SyncWriter({roomId, fragmentIdComparer: this._fragmentIdComparer});
this._emitCollectionChange = emitCollectionChange;
this._sendQueue = new SendQueue({roomId, storage, hsApi, pendingEvents});
this._timeline = null;
@ -53,7 +53,7 @@ export class Room extends EventEmitter {
this._roomEncryption = null;
this._getSyncToken = getSyncToken;
this._clock = clock;
}
}
_readRetryDecryptCandidateEntries(sinceEventKey, txn) {
if (sinceEventKey) {
@ -204,7 +204,7 @@ export class Room extends EventEmitter {
/** @package */
async writeSync(roomResponse, isInitialSync, {summaryChanges, decryptChanges, roomEncryption}, txn) {
const {entries, newLiveKey, memberChanges} =
const {entries, newLiveKey, memberChanges} =
await this._syncWriter.writeSync(roomResponse, txn);
if (decryptChanges) {
const decryption = await decryptChanges.write(txn);
@ -286,7 +286,7 @@ export class Room extends EventEmitter {
if (removedPendingEvents) {
this._sendQueue.emitRemovals(removedPendingEvents);
}
}
}
needsAfterSyncCompleted({memberChanges}) {
return this._roomEncryption?.needsToShareKeys(memberChanges);
@ -321,7 +321,7 @@ export class Room extends EventEmitter {
}
/** @package */
async load(summary, txn) {
async load(summary, txn) {
try {
this._summary.load(summary);
if (this._summary.data.encryption) {
@ -338,7 +338,7 @@ export class Room extends EventEmitter {
} catch (err) {
throw new WrappedError(`Could not load room ${this._roomId}`, err);
}
}
}
/** @public */
sendEvent(eventType, content) {