Skip to content

Commit dd29e20

Browse files
committed
Merge branch 'common-fixes'
2 parents 99ce941 + 0d77156 commit dd29e20

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

crates/matrix-sdk/src/room/common.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use ruma::{
1212
room::history_visibility::HistoryVisibility, AnyStateEvent, AnySyncStateEvent, EventType,
1313
},
1414
serde::Raw,
15-
UserId,
15+
EventId, UserId,
1616
};
1717

1818
use crate::{
@@ -190,14 +190,9 @@ impl Common {
190190
Ok(response)
191191
}
192192

193-
/// Sends a request to `/_matrix/client/r0/rooms/{roomId}/event/{eventId}`
194-
/// and returns a `get_room_event::Response` that contains a event
195-
/// (`AnyRoomEvent`).
196-
pub async fn event(
197-
&self,
198-
request: impl Into<get_room_event::Request<'_>>,
199-
) -> Result<RoomEvent> {
200-
let request = request.into();
193+
/// Fetch the event with the given `EventId` in this room.
194+
pub async fn event(&self, event_id: &EventId) -> Result<RoomEvent> {
195+
let request = get_room_event::Request::new(self.room_id(), event_id);
201196
let event = self.client.send(request, None).await?.event.deserialize()?;
202197

203198
#[cfg(feature = "encryption")]
@@ -281,9 +276,9 @@ impl Common {
281276

282277
/// Get active members for this room, includes invited, joined members.
283278
///
284-
/// *Note*: This method will fetch the members from the homeserver if the
285-
/// member list isn't synchronized due to member lazy loading. Because of
286-
/// that, it might panic if it isn't run on a tokio thread.
279+
/// *Note*: This method will not fetch the members from the homeserver if
280+
/// the member list isn't synchronized due to member lazy loading. Thus,
281+
/// members could be missing from the list.
287282
///
288283
/// Use [active_members()](#method.active_members) if you want to ensure to
289284
/// always get the full member list.

0 commit comments

Comments
 (0)