-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply (polls) push rules client side for encrypted rooms #7356
Apply (polls) push rules client side for encrypted rooms #7356
Conversation
Codecov ReportBase: 12.07% // Head: 12.09% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7356 +/- ##
===========================================
+ Coverage 12.07% 12.09% +0.01%
===========================================
Files 1638 1637 -1
Lines 161989 161863 -126
Branches 66513 66446 -67
===========================================
+ Hits 19568 19577 +9
+ Misses 141775 141639 -136
- Partials 646 647 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
RiotNSE/NotificationService.swift
Outdated
if let actions = pushRule?.actions as? [MXPushRuleAction], | ||
actions.contains(where: { $0.actionType == MXPushRuleActionTypeDontNotify }) { | ||
onComplete(nil, false) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd create a private extension of MXPushRule
to increase readability:
private extension MXPushRule {
var cannotNotify: Bool {
let actions = (actions as? [MXPushRuleAction]) ?? []
return enabled && actions.contains { $0.actionType == MXPushRuleActionTypeDontNotify }
}
}
wdyt?
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
if the actions contains the dont_notify one, the notification shouldn't be displayed