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" ] }
16async-std = { version = "1.5.0", features = [ "unstable" ] } 16async-std = { version = "1.5.0", features = [ "unstable" ] }
17clap = "2.33.0" 17clap = "2.33.0"
18async-trait = "0.1.29" 18async-trait = "0.1.29"
19uuid = { version = "0.8.1", features = ["v4"] }
19 20
20weechat = { git = "https://github.com/poljar/rust-weechat", features = ["async-executor"] } 21weechat = { git = "https://github.com/poljar/rust-weechat", features = ["async-executor"] }
21weechat-sys = { git = "https://github.com/poljar/rust-weechat" } 22weechat-sys = { git = "https://github.com/poljar/rust-weechat" }
src/server.rs +4 −1
@@ -58,6 +58,7 @@ use std::rc::{Rc, Weak};
58use std::time::Duration; 58use std::time::Duration;
59use tokio::runtime::Runtime; 59use tokio::runtime::Runtime;
60use url::Url; 60use url::Url;
61use uuid::Uuid;
61 62
62use matrix_sdk::api::r0::session::login::Response as LoginResponse; 63use matrix_sdk::api::r0::session::login::Response as LoginResponse;
63 64
@@ -646,7 +647,9 @@ impl MatrixServer {
646 // TODO awaiting here means we can only send one message 647 // TODO awaiting here means we can only send one message
647 // at a time, we need to spawn a task here and return a 648 // at a time, we need to spawn a task here and return a
648 // oneshot channel that the caller can await. 649 // 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;
650 653
651 match ret { 654 match ret {
652 Ok(_r) => (), 655 Ok(_r) => (),