Commit bea2e3f5ba

bea2e3f5ba2f79eca8abdce49df42b84675b1261

parent: 4baa1e6134

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-03-28 11:28 UTC

server: Update to the latest rust-sdk changes.

Layout: unified · split

Cargo.toml +2 −3
@@ -10,7 +10,7 @@ name = "matrix"
1010crate-type = ["dylib"]
1111
1212[dependencies]
13libc = "0.2.67"
13libc = "0.2.68"
1414url = "2.1.1"
1515tokio = { version = "0.2.13", features = [ "rt-threaded" ] }
1616async-std = { version = "1.5.0", features = [ "unstable" ] }
@@ -21,6 +21,5 @@ weechat-sys = { git = "https://github.com/poljar/rust-weechat" }
2121
2222[dependencies.matrix-sdk]
2323git = "https://github.com/matrix-org/matrix-rust-sdk/"
24branch = "encryption"
2524default-features = false
26features = ["encryption"]
25features = ["encryption", "sqlite-cryptostore"]
src/server.rs +4 −4
@@ -54,6 +54,7 @@ use async_std::sync::channel as async_channel;
5454use async_std::sync::{Receiver, Sender};
5555use std::cell::RefCell;
5656use std::collections::HashMap;
57use std::time::Duration;
5758use std::rc::{Rc, Weak};
5859use tokio::runtime::Runtime;
5960use url::Url;
@@ -80,7 +81,7 @@ use crate::room_buffer::RoomBuffer;
8081use crate::Config;
8182use crate::PLUGIN_NAME;
8283
83const DEFAULT_SYNC_TIMEOUT: i32 = 30000;
84const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30);
8485
8586pub enum ThreadMessage {
8687 LoginMessage(LoginResponse),
@@ -526,7 +527,7 @@ impl MatrixServer {
526527 password: String,
527528 ) {
528529 if !client.logged_in().await {
529 let ret = client.login(username, password, None).await;
530 let ret = client.login(username, password, None, Some("Weechat-Matrix".to_owned())).await;
530531
531532 match ret {
532533 Ok(response) => {
@@ -543,8 +544,7 @@ impl MatrixServer {
543544
544545 let sync_token = client.sync_token().await;
545546 let sync_settings = SyncSettings::new()
546 .timeout(DEFAULT_SYNC_TIMEOUT)
547 .expect("Invalid sync timeout");
547 .timeout(DEFAULT_SYNC_TIMEOUT);
548548
549549 let sync_settings = if let Some(t) = sync_token {
550550 sync_settings.token(t)