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): add RequestToJoinRoom subscriptions #4338

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jmartinesp
Copy link
Contributor

  • Public API changes documented in changelogs (optional)

Signed-off-by:

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 75.63025% with 29 lines in your changes missing coverage. Please review.

Project coverage is 85.02%. Comparing base (37f52e1) to head (e3cd7cc).

Files with missing lines Patch % Lines
crates/matrix-sdk/src/room/mod.rs 83.78% 12 Missing ⚠️
crates/matrix-sdk/src/room/request_to_join.rs 53.84% 6 Missing ⚠️
crates/matrix-sdk-sqlite/src/state_store.rs 0.00% 5 Missing ⚠️
...ates/matrix-sdk-base/src/deserialized_responses.rs 66.66% 3 Missing ⚠️
crates/matrix-sdk-base/src/store/memory_store.rs 75.00% 2 Missing ⚠️
crates/matrix-sdk/src/test_utils/mocks.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4338      +/-   ##
==========================================
- Coverage   85.08%   85.02%   -0.07%     
==========================================
  Files         276      277       +1     
  Lines       30371    30488     +117     
==========================================
+ Hits        25842    25921      +79     
- Misses       4529     4567      +38     

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


/// Declines the request to join by banning the user from the room with an
/// optional reason.
pub async fn decline_and_ban(&self, reason: Option<String>) -> Result<(), ClientError> {
Copy link
Contributor

@ganfra ganfra Nov 27, 2024

Choose a reason for hiding this comment

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

maybe we want a separate ban action, and let the user chain? in the case the user doesn't have the right for both

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean kick, then ban? Can we ban a user who already left the room?

Also, I'd expect the UI to not display the component that triggers this action rather than controlling trying to workaround the issue here.

Copy link
Contributor

@ganfra ganfra Nov 27, 2024

Choose a reason for hiding this comment

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

Sorry I'm stupid. :D

This comment was marked as resolved.

}

#[matrix_sdk_ffi_macros::export]
impl RequestToJoinActions {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing mark_as_seen?

Also, add a couple of method to mark requests as seen and retrieve the current ones from the stores and update this observable field.
This struct is an abstraction over a room member or state event with knock membership.
Also add mocks for the `/members` endpoint.
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