-
Notifications
You must be signed in to change notification settings - Fork 269
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 fn Room::own_membership_details #4529
Conversation
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.
Looks sensible, a test for the method would be nice.
/// current user's [`RoomMember`](RoomMember) info and the member info | ||
/// of the sender of that member event. | ||
/// - If the current user is not present, an error. | ||
pub async fn own_membership_details(&self) -> Result<(RoomMember, Option<RoomMember>)> { |
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.
Can we get a simple smoke test for this method, I know it's a pretty simple method but it would still be nice to test its basic functionality.
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.
Added a few tests and force pushed. Thanks for the reminder, that uncovered a subtle bug!
This will retrieve the room member info of both the current user and the info for the sender of the current user's room member event.
Also add `membership_change_reason` field to `ffi::RoomMember`.
15f8457
to
c0f7ff0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4529 +/- ##
==========================================
+ Coverage 85.43% 85.45% +0.02%
==========================================
Files 285 285
Lines 32101 32112 +11
==========================================
+ Hits 27426 27442 +16
+ Misses 4675 4670 -5 ☔ View full report in Codecov by Sentry. |
This will retrieve the room member info of both the current user and the info for the sender of the current user's room member event and make it accessible in the FFI layer.
This is needed for
RoomPreview
to display messages such as 'you were banned from this room by Foo'.Signed-off-by: