Commit 74742a31a8

74742a31a8d0e2678ec18a16df73430340f63b2a

parent: ab93f4c915

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-04-14 16:53 UTC

server: Set a UUID when sending a room message.

Layout: unified · split

Cargo.toml +1
@@ -16,6 +16,7 @@ tokio = { version = "0.2.13", features = [ "rt-threaded" ] }
1616async-std = { version = "1.5.0", features = [ "unstable" ] }
1717clap = "2.33.0"
1818async-trait = "0.1.29"
19uuid = { version = "0.8.1", features = ["v4"] }
1920
2021weechat = { git = "https://github.com/poljar/rust-weechat", features = ["async-executor"] }
2122weechat-sys = { git = "https://github.com/poljar/rust-weechat" }
src/server.rs +4 −1
@@ -58,6 +58,7 @@ use std::rc::{Rc, Weak};
5858use std::time::Duration;
5959use tokio::runtime::Runtime;
6060use url::Url;
61use uuid::Uuid;
6162
6263use matrix_sdk::api::r0::session::login::Response as LoginResponse;
6364
@@ -646,7 +647,9 @@ impl MatrixServer {
646647 // TODO awaiting here means we can only send one message
647648 // at a time, we need to spawn a task here and return a
648649 // oneshot channel that the caller can await.
649 let ret = client.room_send(&room_id, content).await;
650 // TODO the room should remember the UUID for the local echo
651 // implementation.
652 let ret = client.room_send(&room_id, content, Some(Uuid::new_v4())).await;
650653
651654 match ret {
652655 Ok(_r) => (),