Skip to content
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

Merged
merged 6 commits into from
Feb 13, 2023

Conversation

flescio
Copy link
Contributor

@flescio flescio commented Feb 9, 2023

if the actions contains the dont_notify one, the notification shouldn't be displayed

@flescio flescio requested review from alfogrillo, a team and aringenbach and removed request for a team February 9, 2023 11:00
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 12.07% // Head: 12.09% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (2c89e9d) compared to base (c39c50f).
Patch has no changes to coverable lines.

❗ Current head 2c89e9d differs from pull request most recent head ad716eb. Consider uploading reports for the commit ad716eb to get more accurate results

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     
Flag Coverage Δ
uitests 55.39% <ø> (+0.02%) ⬆️
unittests 5.97% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Riot/Modules/MatrixKit/Models/MXKAppSettings.m 36.44% <0.00%> (-0.20%) ⬇️
...Modules/Common/Recents/Views/RecentTableViewCell.m 0.00% <0.00%> (ø)
...ules/MatrixKit/Models/RoomList/MXKRecentCellData.m 0.00% <0.00%> (ø)
...es/Room/VoiceMessages/VoiceMessageController.swift 0.00% <0.00%> (ø)
...s/Room/VoiceMessages/VoiceMessageAudioPlayer.swift 0.00% <0.00%> (ø)
...Room/VoiceMessages/VoiceMessageAudioRecorder.swift 0.00% <0.00%> (ø)
...VoiceMessages/VoiceMessagePlaybackController.swift 0.00% <0.00%> (ø)
...iceMessages/VoiceMessageMediaServiceProvider.swift 0.00% <0.00%> (ø)
...imelinePoll/Coordinator/TimelinePollProvider.swift 0.00% <0.00%> (ø)
...yWait/KeyVerificationSelfVerifyWaitViewModel.swift 0.00% <0.00%> (ø)
... and 6 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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@aringenbach aringenbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 387 to 391
if let actions = pushRule?.actions as? [MXPushRuleAction],
actions.contains(where: { $0.actionType == MXPushRuleActionTypeDontNotify }) {
onComplete(nil, false)
return
}
Copy link
Contributor

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?

@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@alfogrillo alfogrillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

@flescio flescio merged commit f36f578 into develop Feb 13, 2023
@flescio flescio deleted the flescio/apply_poll_push_rules_encrypted-rooms branch February 13, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants