Skip to content

Commit

Permalink
Fix push rule evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Airyzz committed Dec 3, 2023
1 parent eece5a5 commit b6af2bf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions commet/lib/client/matrix/matrix_room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ class MatrixRoom extends Room {
senderName: sender.displayName,
senderId: sender.identifier,
roomName: displayName,
senderImage: sender.avatar,
roomImage: avatar,
content: event.body ?? "Received a message",
eventId: event.eventId,
roomId: identifier,
Expand All @@ -261,15 +263,10 @@ class MatrixRoom extends Room {
return false;
}

if (pushRule == PushRule.dontNotify) {
return false;
}

if (pushRule == PushRule.mentionsOnly && !event.highlight) {
return false;
}
var evaluator = _matrixRoom.client.pushruleEvaluator;
var match = evaluator.match((event as MatrixTimelineEvent).event);

return true;
return match.notify;
}

@override
Expand Down

0 comments on commit b6af2bf

Please sign in to comment.