From 4c2b973e4de1f35855e0035c4ce0f6e9db56de1e Mon Sep 17 00:00:00 2001 From: sherlock Date: Fri, 29 Sep 2023 14:04:08 +0700 Subject: [PATCH] feat: move mute and unmute to extension of room --- lib/domain/model/room/room_extension.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/domain/model/room/room_extension.dart b/lib/domain/model/room/room_extension.dart index 10a5627920..b70f7ef3b5 100644 --- a/lib/domain/model/room/room_extension.dart +++ b/lib/domain/model/room/room_extension.dart @@ -37,4 +37,12 @@ extension RoomExtension on Room { EventTypes.Encrypted, ].contains(lastEvent?.type); } + + Future mute() async { + await setPushRuleState(PushRuleState.mentionsOnly); + } + + Future unmute() async { + await setPushRuleState(PushRuleState.notify); + } }