From 69ab855efa391b779a82ec8a8f9fa2af76e64053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Wed, 9 Apr 2025 14:27:37 +0200 Subject: [PATCH] refactor(room): add `RoomMemberWithSenderInfo` struct. This will hold the info for both the room member whose sender id was provided and the sender of the `m.room.member` event from which the `RoomMember` is built. --- crates/matrix-sdk/src/room/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/matrix-sdk/src/room/mod.rs b/crates/matrix-sdk/src/room/mod.rs index 9fd1d8774..5b07c54e4 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -3829,6 +3829,17 @@ impl EventSource for &Room { #[error("out of range conversion attempted")] pub struct TryFromReportedContentScoreError(()); +/// Contains the current user's room member info and the optional room member +/// info of the sender of the `m.room.member` event that this info represents. +#[derive(Debug)] +pub struct RoomMemberWithSenderInfo { + /// The actual room member. + pub room_member: RoomMember, + /// The info of the sender of the event `room_member` is based on, if + /// available. + pub sender_info: Option, +} + #[cfg(all(test, not(target_arch = "wasm32")))] mod tests { use assert_matches2::assert_matches;