From 6d7e7beaaadd5d46f9ca93d2c453a22ac9281f25 Mon Sep 17 00:00:00 2001 From: Terence ZAFINDRATAFA Date: Fri, 8 Mar 2024 10:17:39 +0000 Subject: [PATCH] TW1504: condition added to check if room is muted for local notif --- lib/widgets/local_notifications_extension.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/widgets/local_notifications_extension.dart b/lib/widgets/local_notifications_extension.dart index bd94c0a2a4..b688b89cdc 100644 --- a/lib/widgets/local_notifications_extension.dart +++ b/lib/widgets/local_notifications_extension.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'package:fluffychat/domain/model/room/room_extension.dart'; import 'package:flutter/foundation.dart'; import 'package:desktop_lifecycle/desktop_lifecycle.dart'; @@ -35,7 +36,8 @@ extension LocalNotificationsExtension on MatrixState { Logs().w('Can not display notification for unknown room $roomId'); return; } - if (room.notificationCount == 0) return; + if (room.notificationCount == 0 || + (room.isMuted && room.highlightCount == 0)) return; final event = Event.fromJson(eventUpdate.content, room); final title = room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)); final body = await event.calcLocalizedBody(