Commit bea2e3f5ba
Unsigned
Layout: unified · split
Cargo.toml +2 −3
| @@ -10,7 +10,7 @@ name = "matrix" | ||
| 10 | 10 | crate-type = ["dylib"] |
| 11 | 11 | |
| 12 | 12 | [dependencies] |
| 13 | libc = "0.2.67" | |
| 13 | libc = "0.2.68" | |
| 14 | 14 | url = "2.1.1" |
| 15 | 15 | tokio = { version = "0.2.13", features = [ "rt-threaded" ] } |
| 16 | 16 | async-std = { version = "1.5.0", features = [ "unstable" ] } |
| @@ -21,6 +21,5 @@ weechat-sys = { git = "https://github.com/poljar/rust-weechat" } | ||
| 21 | 21 | |
| 22 | 22 | [dependencies.matrix-sdk] |
| 23 | 23 | git = "https://github.com/matrix-org/matrix-rust-sdk/" |
| 24 | branch = "encryption" | |
| 25 | 24 | default-features = false |
| 26 | features = ["encryption"] | |
| 25 | features = ["encryption", "sqlite-cryptostore"] | |
src/server.rs +4 −4
| @@ -54,6 +54,7 @@ use async_std::sync::channel as async_channel; | ||
| 54 | 54 | use async_std::sync::{Receiver, Sender}; |
| 55 | 55 | use std::cell::RefCell; |
| 56 | 56 | use std::collections::HashMap; |
| 57 | use std::time::Duration; | |
| 57 | 58 | use std::rc::{Rc, Weak}; |
| 58 | 59 | use tokio::runtime::Runtime; |
| 59 | 60 | use url::Url; |
| @@ -80,7 +81,7 @@ use crate::room_buffer::RoomBuffer; | ||
| 80 | 81 | use crate::Config; |
| 81 | 82 | use crate::PLUGIN_NAME; |
| 82 | 83 | |
| 83 | const DEFAULT_SYNC_TIMEOUT: i32 = 30000; | |
| 84 | const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30); | |
| 84 | 85 | |
| 85 | 86 | pub enum ThreadMessage { |
| 86 | 87 | LoginMessage(LoginResponse), |
| @@ -526,7 +527,7 @@ impl MatrixServer { | ||
| 526 | 527 | password: String, |
| 527 | 528 | ) { |
| 528 | 529 | 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; | |
| 530 | 531 | |
| 531 | 532 | match ret { |
| 532 | 533 | Ok(response) => { |
| @@ -543,8 +544,7 @@ impl MatrixServer { | ||
| 543 | 544 | |
| 544 | 545 | let sync_token = client.sync_token().await; |
| 545 | 546 | let sync_settings = SyncSettings::new() |
| 546 | .timeout(DEFAULT_SYNC_TIMEOUT) | |
| 547 | .expect("Invalid sync timeout"); | |
| 547 | .timeout(DEFAULT_SYNC_TIMEOUT); | |
| 548 | 548 | |
| 549 | 549 | let sync_settings = if let Some(t) = sync_token { |
| 550 | 550 | sync_settings.token(t) |