Update docs

This commit is contained in:
Will Hunt
2025-04-10 10:13:19 +01:00
parent a217cb1c1e
commit b37b5609b0

View File

@@ -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<boolean> {
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);
}
}