From 9e736bec84eaf348b149e65174a6b6f0afd3adac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Fri, 4 Mar 2022 13:00:42 +0100 Subject: [PATCH] ruma: Fix hello_isahc example --- crates/ruma/Cargo.toml | 2 +- crates/ruma/examples/hello_isahc.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/ruma/Cargo.toml b/crates/ruma/Cargo.toml index 5b22fafe..a776141c 100644 --- a/crates/ruma/Cargo.toml +++ b/crates/ruma/Cargo.toml @@ -166,7 +166,7 @@ required-features = ["client-api-c", "client-ext-client-api", "client-hyper-nati [[example]] name = "hello_isahc" -required-features = ["client-api-c", "client-ext-client-api", "client-isahc"] +required-features = ["client-api-c", "client-ext-client-api", "client-isahc", "rand"] [[example]] name = "message_log" diff --git a/crates/ruma/examples/hello_isahc.rs b/crates/ruma/examples/hello_isahc.rs index 8f2192b0..3777cd62 100644 --- a/crates/ruma/examples/hello_isahc.rs +++ b/crates/ruma/examples/hello_isahc.rs @@ -6,9 +6,8 @@ use std::{convert::TryFrom, env, process::exit}; use ruma::{ api::client::{alias::get_alias, membership::join_room_by_id, message::send_message_event}, events::room::message::RoomMessageEventContent, - RoomAliasId, + RoomAliasId, TransactionId, }; -use ruma_common::api::MatrixVersion; async fn hello_world( homeserver_url: String, @@ -24,9 +23,9 @@ async fn hello_world( let room_id = client.send_request(get_alias::v3::Request::new(room_alias)).await?.room_id; client.send_request(join_room_by_id::v3::Request::new(&room_id)).await?; client - .send_request(send_message_event::Request::new( + .send_request(send_message_event::v3::Request::new( &room_id, - "1", + &TransactionId::new(), &RoomMessageEventContent::text_plain("Hello World!"), )?) .await?;