Skip to content

Commit f0c7370

Browse files
committed
feat(ffi): expose the inviter directly on the room to avoid having to fetch the room preview
The room preview doesn't actually contain the inviter but instead retrieves it from the room invite details.
1 parent f108840 commit f0c7370

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bindings/matrix-sdk-ffi/src/room.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ impl Room {
134134
self.inner.alt_aliases().iter().map(|a| a.to_string()).collect()
135135
}
136136

137+
/// Get the user who created the invite, if any.
138+
pub async fn inviter(&self) -> Result<Option<RoomMember>, ClientError> {
139+
let invite_details = self.inner.invite_details().await?;
140+
141+
match invite_details.inviter {
142+
Some(inviter) => Ok(Some(inviter.try_into()?)),
143+
None => Ok(None),
144+
}
145+
}
146+
137147
pub fn membership(&self) -> Membership {
138148
self.inner.state().into()
139149
}

0 commit comments

Comments
 (0)