Skip to content

Commit

Permalink
TW1504: condition added to check if room is muted for local notif
Browse files Browse the repository at this point in the history
  • Loading branch information
Te-Z authored and hoangdat committed Mar 12, 2024
1 parent d5e13fe commit 6d7e7be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/widgets/local_notifications_extension.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6d7e7be

Please sign in to comment.