Implement MSC3987: Push actions clean-up

This commit is contained in:
Nicolas Mauri
2023-06-06 09:24:55 +02:00
parent e8294f727c
commit c53d4961c9
5 changed files with 56 additions and 18 deletions

View File

@@ -888,6 +888,7 @@ class NotificationService: UNNotificationServiceExtension {
private extension MXPushRule {
var dontNotify: Bool {
let actions = (actions as? [MXPushRuleAction]) ?? []
return actions.contains { $0.actionType == MXPushRuleActionTypeDontNotify }
// Support for MSC3987: The dont_notify push rule action is deprecated and replaced by an empty actions list.
return actions.isEmpty || actions.contains { $0.actionType == MXPushRuleActionTypeDontNotify }
}
}