diff --git a/src/app/molecules/global-notification/GlobalNotification.jsx b/src/app/molecules/global-notification/GlobalNotification.jsx index b115c9dcda..6020cd905d 100644 --- a/src/app/molecules/global-notification/GlobalNotification.jsx +++ b/src/app/molecules/global-notification/GlobalNotification.jsx @@ -53,7 +53,7 @@ export function getTypeActions(type, highlightValue = false) { function useGlobalNotif() { const mx = useMatrixClient(); - const pushRules = useAccountData('m.push_rules')?.getContent(); + const pushRules = useAccountData('pushrules')?.getContent(); const underride = pushRules?.global?.underride ?? []; const rulesToType = { [DM]: notifType.ON, @@ -93,7 +93,7 @@ function useGlobalNotif() { } ruleContent.actions = getTypeActions(type); - mx.setAccountData('m.push_rules', content); + mx.setAccountData('pushrules', content); }; const dmRule = underride.find((rule) => rule.rule_id === DM); diff --git a/src/app/molecules/global-notification/KeywordNotification.jsx b/src/app/molecules/global-notification/KeywordNotification.jsx index 7f7e4deada..3f3b191a72 100644 --- a/src/app/molecules/global-notification/KeywordNotification.jsx +++ b/src/app/molecules/global-notification/KeywordNotification.jsx @@ -29,7 +29,7 @@ const KEYWORD = 'keyword'; function useKeywordNotif() { const mx = useMatrixClient(); - const pushRules = useAccountData('m.push_rules')?.getContent(); + const pushRules = useAccountData('pushrules')?.getContent(); const override = pushRules?.global?.override ?? []; const content = pushRules?.global?.content ?? []; @@ -92,7 +92,7 @@ function useKeywordNotif() { }); } - mx.setAccountData('m.push_rules', evtContent); + mx.setAccountData('pushrules', evtContent); }; const addKeyword = (keyword) => { @@ -104,11 +104,11 @@ function useKeywordNotif() { default: false, actions: getTypeActions(rulesToType[KEYWORD] ?? notifType.NOISY, true), }); - mx.setAccountData('m.push_rules', pushRules); + mx.setAccountData('pushrules', pushRules); }; const removeKeyword = (rule) => { pushRules.global.content = content.filter((r) => r.rule_id !== rule.rule_id); - mx.setAccountData('m.push_rules', pushRules); + mx.setAccountData('pushrules', pushRules); }; const dsRule = override.find((rule) => rule.rule_id === DISPLAY_NAME); diff --git a/src/app/state/room-list/mutedRoomList.ts b/src/app/state/room-list/mutedRoomList.ts index cb56ec0f93..76b2cf8c8c 100644 --- a/src/app/state/room-list/mutedRoomList.ts +++ b/src/app/state/room-list/mutedRoomList.ts @@ -49,7 +49,7 @@ export const useBindMutedRoomsAtom = (mx: MatrixClient, mutedAtom: typeof mutedR const setMuted = useSetAtom(mutedAtom); useEffect(() => { - const overrideRules = mx.getAccountData('m.push_rules')?.getContent() + const overrideRules = mx.getAccountData('pushrules')?.getContent() ?.global?.override; if (overrideRules) { const mutedRooms = overrideRules.reduce((rooms, rule) => { diff --git a/src/app/utils/room.ts b/src/app/utils/room.ts index 5f4615a6ed..c5f4b6dbf8 100644 --- a/src/app/utils/room.ts +++ b/src/app/utils/room.ts @@ -168,7 +168,7 @@ export const getNotificationType = (mx: MatrixClient, roomId: string): Notificat } if (!roomPushRule) { - const overrideRules = mx.getAccountData('m.push_rules')?.getContent() + const overrideRules = mx.getAccountData('pushrules')?.getContent() ?.global?.override; if (!overrideRules) return NotificationType.Default;