From b37b5609b0d9827e158232b8dfe66c37c22ed421 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 10 Apr 2025 10:13:19 +0100 Subject: [PATCH] Update docs --- .../controllers/MediaPreviewConfigController.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/settings/controllers/MediaPreviewConfigController.ts b/src/settings/controllers/MediaPreviewConfigController.ts index 1f3bc09376..89b4bf15ab 100644 --- a/src/settings/controllers/MediaPreviewConfigController.ts +++ b/src/settings/controllers/MediaPreviewConfigController.ts @@ -17,7 +17,8 @@ import { type SettingLevel } from "../SettingLevel.ts"; import MatrixClientBackedController from "./MatrixClientBackedController.ts"; /** - * TODO + * Handles media preview settings provided by MSC4278. + * This uses both account-level and room-level account data. */ export default class MediaPreviewConfigController extends MatrixClientBackedController { public static readonly default: AccountDataEvents["io.element.msc4278.media_preview_config"] = { @@ -27,10 +28,6 @@ export default class MediaPreviewConfigController extends MatrixClientBackedCont private globalSetting: MediaPreviewConfig = MediaPreviewConfigController.default; - public constructor() { - super(); - } - private getRoomValue = (roomId: string): MediaPreviewConfig | null => { return ( this.client @@ -52,7 +49,6 @@ export default class MediaPreviewConfigController extends MatrixClientBackedCont ...MediaPreviewConfigController.default, ...event.getContent(), }; - console.log("CONFIG Updating global settings", this.globalSetting); } }; @@ -85,7 +81,6 @@ export default class MediaPreviewConfigController extends MatrixClientBackedCont newValue: MediaPreviewConfig, ): Promise { if (!this.client) { - // No client! return false; } if (roomId) { @@ -97,8 +92,4 @@ export default class MediaPreviewConfigController extends MatrixClientBackedCont await this.client.setAccountData(MEDIA_PREVIEW_ACCOUNT_DATA_TYPE, newValue); return true; } - - public onChange(_level: SettingLevel, roomId: string | null, newValue: MediaPreviewConfig): void { - console.log("onChange", roomId, newValue); - } }