Harden Settings using mapped types (#28775)

* Harden Settings using mapped types

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix issues found during hardening

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove oidc native flow stale key

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-12-23 20:25:15 +00:00
committed by GitHub
parent 4e1bd69e4d
commit 1e42f28a69
90 changed files with 576 additions and 274 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import { KnownMembership } from "matrix-js-sdk/src/types";
import SettingsStore from "./settings/SettingsStore";
import { IRoomState } from "./components/structures/RoomView";
import { SettingKey } from "./settings/Settings.tsx";
interface IDiff {
isMemberEvent: boolean;
@@ -53,7 +54,7 @@ export default function shouldHideEvent(ev: MatrixEvent, ctx?: IRoomState): bool
// so we should prefer using cached values if a RoomContext is available
const isEnabled = ctx
? (name: keyof IRoomState) => ctx[name]
: (name: string) => SettingsStore.getValue(name, ev.getRoomId());
: (name: SettingKey) => SettingsStore.getValue(name, ev.getRoomId());
// Hide redacted events
// Deleted events with a thread are always shown regardless of user preference