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

feat(room): Separate RoomState::Ban from RoomState::Left. #4414

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

jmartinesp
Copy link
Contributor

This is needed to tell apart rooms in left and banned state in places like RoomInfo or RoomPreview.

The banned rooms will still count as left rooms in the sync processes.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@jmartinesp jmartinesp requested a review from a team as a code owner December 13, 2024 13:26
@jmartinesp jmartinesp requested review from bnjbvr and removed request for a team December 13, 2024 13:26
@jmartinesp jmartinesp force-pushed the feat/separate-banned-room-state-from-left branch 2 times, most recently from 184ce24 to 0d2eaf5 Compare December 13, 2024 13:42
Comment on lines +1931 to +2027
if self.contains(Self::KNOCKED) {
states.push(RoomState::Knocked);
}
Copy link
Contributor Author

@jmartinesp jmartinesp Dec 13, 2024

Choose a reason for hiding this comment

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

Oops, this was never added when the behaviour changed before. I added a test including these 2 new cases.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.31%. Comparing base (34ea42a) to head (e33d0db).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-base/src/sliding_sync/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4414      +/-   ##
==========================================
+ Coverage   85.30%   85.31%   +0.01%     
==========================================
  Files         283      283              
  Lines       31435    31442       +7     
==========================================
+ Hits        26815    26826      +11     
+ Misses       4620     4616       -4     

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

@jmartinesp jmartinesp force-pushed the feat/separate-banned-room-state-from-left branch 2 times, most recently from 399fe21 to 505e809 Compare December 13, 2024 14:44
@@ -218,14 +218,14 @@ pub enum RoomState {
Invited,
/// The room is in a knocked state.
Knocked,
/// The room is in a banned state.
Ban,
Copy link
Member

Choose a reason for hiding this comment

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

Can you name this Banned, for consistency with the other states?

This is needed to tell apart rooms in left and banned state in places like `RoomInfo` or `RoomPreview`.

The banned rooms will still count as left rooms in the sync processes.
@jmartinesp jmartinesp force-pushed the feat/separate-banned-room-state-from-left branch from 505e809 to e33d0db Compare December 16, 2024 17:38
@jmartinesp jmartinesp enabled auto-merge (rebase) December 16, 2024 17:39
@jmartinesp jmartinesp merged commit 866b5fe into main Dec 16, 2024
40 checks passed
@jmartinesp jmartinesp deleted the feat/separate-banned-room-state-from-left branch December 16, 2024 18:19
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.

2 participants