Skip to content

ffi: RoomInfo notification mode must reflect the user-defined mode #2545

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

Merged
merged 4 commits into from
Sep 14, 2023

Conversation

nimau
Copy link
Contributor

@nimau nimau commented Sep 12, 2023

With this PR, the notification mode in RoomInfo now reflects the user-defined mode.

@nimau nimau requested a review from a team as a code owner September 12, 2023 16:12
@nimau nimau requested review from poljar and removed request for a team September 12, 2023 16:12
@@ -63,7 +63,7 @@ impl RoomInfo {
joined_members_count: room.joined_members_count(),
highlight_count: unread_notification_counts.highlight_count,
notification_count: unread_notification_counts.notification_count,
notification_mode: room.notification_mode().await.map(Into::into),
notification_mode: room.notification_mode(true).await.map(Into::into),
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not really clear what (true) means as an argument list for .notification_mode(). Maybe we should have separate notification_mode and user_defined_notification_mode or notification_mode and effective_notification_mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I've added a separate user_defined_notification_mode() function.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: -0.03% ⚠️

Comparison is base (a4101e2) 77.48% compared to head (d56cbb1) 77.46%.
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2545      +/-   ##
==========================================
- Coverage   77.48%   77.46%   -0.03%     
==========================================
  Files         180      180              
  Lines       19364    19369       +5     
==========================================
- Hits        15005    15004       -1     
- Misses       4359     4365       +6     
Files Changed Coverage Δ
crates/matrix-sdk/src/room/mod.rs 82.57% <80.00%> (-0.03%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nimau nimau requested a review from jplatte September 13, 2023 07:39
@langleyd
Copy link
Contributor

This is required to fix element-hq/element-x-ios#1648

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Left a question, looks good otherwise. We can merge if you disagree.

@@ -63,7 +63,7 @@ impl RoomInfo {
joined_members_count: room.joined_members_count(),
highlight_count: unread_notification_counts.highlight_count,
notification_count: unread_notification_counts.notification_count,
notification_mode: room.notification_mode().await.map(Into::into),
notification_mode: room.user_defined_notification_mode().await.map(Into::into),
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need notification_mode anymore? Would it make sense to name the notification_mode field the same way as the method we're calling, i.e. user_defined_notification_mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes. Ok, I've renamed it.

@nimau nimau requested a review from poljar September 14, 2023 10:18
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Thanks, looks good.

@poljar
Copy link
Contributor

poljar commented Sep 14, 2023

Oh, except cargo fmt disagrees. Can you fix the quickly? After that we can merge.

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.

4 participants