diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index 4b051cf795..02aa915fa5 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -49,8 +49,8 @@ import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNo import { NOTIFICATION_STATE_UPDATE, NotificationState } from "../../../stores/notifications/NotificationState"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { EchoChamber } from "../../../stores/local-echo/EchoChamber"; -import { CachedRoomKey, RoomCachedEcho } from "../../../stores/local-echo/RoomCachedEcho"; -import { PROPERTY_UPDATED } from "../../../stores/local-echo/CachedEcho"; +import { CachedRoomKey, RoomEchoChamber } from "../../../stores/local-echo/RoomEchoChamber"; +import { PROPERTY_UPDATED } from "../../../stores/local-echo/GenericEchoChamber"; interface IProps { room: Room; @@ -108,7 +108,7 @@ export default class RoomTile extends React.PureComponent { private dispatcherRef: string; private roomTileRef = createRef(); private notificationState: NotificationState; - private roomProps: RoomCachedEcho; + private roomProps: RoomEchoChamber; constructor(props: IProps) { super(props); diff --git a/src/stores/local-echo/EchoChamber.ts b/src/stores/local-echo/EchoChamber.ts index 4c5109da2d..f61e521728 100644 --- a/src/stores/local-echo/EchoChamber.ts +++ b/src/stores/local-echo/EchoChamber.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { RoomCachedEcho } from "./RoomCachedEcho"; +import { RoomEchoChamber } from "./RoomEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; import { EchoStore } from "./EchoStore"; @@ -25,7 +25,7 @@ export class EchoChamber { private constructor() { } - public static forRoom(room: Room): RoomCachedEcho { - return EchoStore.instance.getOrCreateEchoForRoom(room); + public static forRoom(room: Room): RoomEchoChamber { + return EchoStore.instance.getOrCreateChamberForRoom(room); } } diff --git a/src/stores/local-echo/EchoStore.ts b/src/stores/local-echo/EchoStore.ts index ef2ee2d275..76e90be45e 100644 --- a/src/stores/local-echo/EchoStore.ts +++ b/src/stores/local-echo/EchoStore.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { CachedEcho } from "./CachedEcho"; +import { GenericEchoChamber } from "./GenericEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; -import { RoomCachedEcho } from "./RoomCachedEcho"; +import { RoomEchoChamber } from "./RoomEchoChamber"; import { RoomEchoContext } from "./RoomEchoContext"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -36,7 +36,7 @@ const roomContextKey = (room: Room): ContextKey => `room-${room.roomId}`; export class EchoStore extends AsyncStoreWithClient { private static _instance: EchoStore; - private caches = new Map>(); + private caches = new Map>(); constructor() { super(defaultDispatcher); @@ -53,15 +53,15 @@ export class EchoStore extends AsyncStoreWithClient { return Array.from(this.caches.values()).map(e => e.context); } - public getOrCreateEchoForRoom(room: Room): RoomCachedEcho { + public getOrCreateChamberForRoom(room: Room): RoomEchoChamber { if (this.caches.has(roomContextKey(room))) { - return this.caches.get(roomContextKey(room)) as RoomCachedEcho; + return this.caches.get(roomContextKey(room)) as RoomEchoChamber; } const context = new RoomEchoContext(room); context.whenAnything(() => this.checkContexts()); - const echo = new RoomCachedEcho(context); + const echo = new RoomEchoChamber(context); echo.setClient(this.matrixClient); this.caches.set(roomContextKey(room), echo); diff --git a/src/stores/local-echo/CachedEcho.ts b/src/stores/local-echo/GenericEchoChamber.ts similarity index 97% rename from src/stores/local-echo/CachedEcho.ts rename to src/stores/local-echo/GenericEchoChamber.ts index ce89e639c9..7bedc9bde8 100644 --- a/src/stores/local-echo/CachedEcho.ts +++ b/src/stores/local-echo/GenericEchoChamber.ts @@ -25,7 +25,7 @@ export async function implicitlyReverted() { export const PROPERTY_UPDATED = "property_updated"; -export abstract class CachedEcho extends EventEmitter { +export abstract class GenericEchoChamber extends EventEmitter { private cache = new Map(); protected matrixClient: MatrixClient; diff --git a/src/stores/local-echo/RoomCachedEcho.ts b/src/stores/local-echo/RoomEchoChamber.ts similarity index 92% rename from src/stores/local-echo/RoomCachedEcho.ts rename to src/stores/local-echo/RoomEchoChamber.ts index 3ac01d3873..e113f68c32 100644 --- a/src/stores/local-echo/RoomCachedEcho.ts +++ b/src/stores/local-echo/RoomEchoChamber.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { CachedEcho, implicitlyReverted, PROPERTY_UPDATED } from "./CachedEcho"; +import { GenericEchoChamber, implicitlyReverted, PROPERTY_UPDATED } from "./GenericEchoChamber"; import { getRoomNotifsState, setRoomNotifsState } from "../../RoomNotifs"; import { RoomEchoContext } from "./RoomEchoContext"; import { _t } from "../../languageHandler"; @@ -27,7 +27,7 @@ export enum CachedRoomKey { NotificationVolume, } -export class RoomCachedEcho extends CachedEcho { +export class RoomEchoChamber extends GenericEchoChamber { private properties = new Map(); public constructor(context: RoomEchoContext) {