docs(sdk): Simplify the event sending examples
This commit is contained in:
parent
28412344d5
commit
ff9bb94ab4
1 changed files with 2 additions and 5 deletions
|
@ -377,9 +377,7 @@ impl Joined {
|
||||||
/// # let mut client = Client::new(homeserver)?;
|
/// # let mut client = Client::new(homeserver)?;
|
||||||
/// # let room_id = room_id!("!test:localhost");
|
/// # let room_id = room_id!("!test:localhost");
|
||||||
///
|
///
|
||||||
/// let content = AnyMessageEventContent::RoomMessage(
|
/// let content = MessageEventContent::text_plain("Hello world");
|
||||||
/// MessageEventContent::text_plain("Hello world")
|
|
||||||
/// );
|
|
||||||
///
|
///
|
||||||
/// let txn_id = Uuid::new_v4();
|
/// let txn_id = Uuid::new_v4();
|
||||||
///
|
///
|
||||||
|
@ -652,12 +650,11 @@ impl Joined {
|
||||||
/// # let room_id = matrix_sdk::ruma::room_id!("!test:localhost");
|
/// # let room_id = matrix_sdk::ruma::room_id!("!test:localhost");
|
||||||
///
|
///
|
||||||
/// let avatar_url = mxc_uri!("mxc://example.org/avatar");
|
/// let avatar_url = mxc_uri!("mxc://example.org/avatar");
|
||||||
/// let member_event = assign!(MemberEventContent::new(MembershipState::Join), {
|
/// let content = assign!(MemberEventContent::new(MembershipState::Join), {
|
||||||
/// avatar_url: Some(avatar_url),
|
/// avatar_url: Some(avatar_url),
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
/// if let Some(room) = client.get_joined_room(&room_id) {
|
/// if let Some(room) = client.get_joined_room(&room_id) {
|
||||||
/// let content = AnyStateEventContent::RoomMember(member_event);
|
|
||||||
/// room.send_state_event(content, "").await?;
|
/// room.send_state_event(content, "").await?;
|
||||||
/// }
|
/// }
|
||||||
/// # matrix_sdk::Result::Ok(()) });
|
/// # matrix_sdk::Result::Ok(()) });
|
||||||
|
|
Loading…
Reference in a new issue