Commit 43b159a006
Unregistered key
Layout: unified · split
src/room_buffer.rs +2 −2
| @@ -111,7 +111,7 @@ impl RoomBuffer { | ||
| 111 | 111 | |
| 112 | 112 | let buffer_settings = BufferSettingsAsync::new(&room_id.to_string()) |
| 113 | 113 | .input_callback(room.clone()) |
| 114 | .close_callback(|weechat, buffer| { | |
| 114 | .close_callback(|weechat: &Weechat, buffer: &Buffer| { | |
| 115 | 115 | // TODO remove the roombuffer from the server here. |
| 116 | 116 | // TODO leave the room if the plugin isn't unloading. |
| 117 | 117 | Ok(()) |
| @@ -148,7 +148,7 @@ impl RoomBuffer { | ||
| 148 | 148 | |
| 149 | 149 | pub fn calculate_buffer_name(&self) -> String { |
| 150 | 150 | let room = self.room(); |
| 151 | let room_name = room.calculate_name(); | |
| 151 | let room_name = room.display_name(); | |
| 152 | 152 | |
| 153 | 153 | if room_name == "#" { |
| 154 | 154 | "##".to_owned() |
src/server.rs +7 −7
| @@ -69,7 +69,7 @@ use matrix_sdk::{ | ||
| 69 | 69 | room::message::{MessageEventContent, TextMessageEventContent}, |
| 70 | 70 | }, |
| 71 | 71 | identifiers::{RoomId, UserId}, |
| 72 | AsyncClient, AsyncClientConfig, SyncSettings, | |
| 72 | Client, ClientConfig, SyncSettings, | |
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | use weechat::config::{ |
| @@ -149,7 +149,7 @@ pub(crate) struct InnerServer { | ||
| 149 | 149 | room_buffers: HashMap<RoomId, RoomBuffer>, |
| 150 | 150 | settings: ServerSettings, |
| 151 | 151 | config: Config, |
| 152 | client: Option<AsyncClient>, | |
| 152 | client: Option<Client>, | |
| 153 | 153 | login_state: Option<LoginState>, |
| 154 | 154 | connected_state: Rc<RefCell<Option<Connection>>>, |
| 155 | 155 | } |
| @@ -414,13 +414,13 @@ impl InnerServer { | ||
| 414 | 414 | self.login_state = Some(login_state); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | pub fn create_client(&mut self) -> Result<AsyncClient, ServerError> { | |
| 417 | pub fn create_client(&mut self) -> Result<Client, ServerError> { | |
| 418 | 418 | let homeserver = |
| 419 | 419 | self.settings.homeserver.as_ref().ok_or_else(|| { |
| 420 | 420 | ServerError::StartError("Homeserver not configured".to_owned()) |
| 421 | 421 | })?; |
| 422 | 422 | |
| 423 | let mut client_config = AsyncClientConfig::new(); | |
| 423 | let mut client_config = ClientConfig::new(); | |
| 424 | 424 | |
| 425 | 425 | if let Some(proxy) = &self.settings.proxy { |
| 426 | 426 | client_config = client_config |
| @@ -429,7 +429,7 @@ impl InnerServer { | ||
| 429 | 429 | .disable_ssl_verification(); |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | let client = AsyncClient::new_with_config( | |
| 432 | let client = Client::new_with_config( | |
| 433 | 433 | homeserver.clone(), |
| 434 | 434 | None, |
| 435 | 435 | client_config, |
| @@ -522,7 +522,7 @@ impl MatrixServer { | ||
| 522 | 522 | /// This runs on the per server tokio executor. |
| 523 | 523 | /// It communicates with the main Weechat thread using a async channel. |
| 524 | 524 | pub async fn sync_loop( |
| 525 | client: AsyncClient, | |
| 525 | client: Client, | |
| 526 | 526 | channel: Sender<Result<ThreadMessage, String>>, |
| 527 | 527 | username: String, |
| 528 | 528 | password: String, |
| @@ -629,7 +629,7 @@ impl MatrixServer { | ||
| 629 | 629 | /// Send loop that waits for requests that need to be sent out using our |
| 630 | 630 | /// Matrix client. |
| 631 | 631 | pub async fn send_loop( |
| 632 | client: AsyncClient, | |
| 632 | client: Client, | |
| 633 | 633 | channel: Receiver<ServerMessage>, |
| 634 | 634 | ) { |
| 635 | 635 | while let Some(message) = channel.recv().await { |