Commit 43b159a006

43b159a00645803ee1306d04556760eda0f5944a

parent: 341ba19fcc

Unregistered key

Valentin Brandl <vbrandl@riseup.net> · 2020-05-08 15:59 UTC

Fix changes in upstream APIs

Layout: unified · split

src/room_buffer.rs +2 −2
@@ -111,7 +111,7 @@ impl RoomBuffer {
111111
112112 let buffer_settings = BufferSettingsAsync::new(&room_id.to_string())
113113 .input_callback(room.clone())
114 .close_callback(|weechat, buffer| {
114 .close_callback(|weechat: &Weechat, buffer: &Buffer| {
115115 // TODO remove the roombuffer from the server here.
116116 // TODO leave the room if the plugin isn't unloading.
117117 Ok(())
@@ -148,7 +148,7 @@ impl RoomBuffer {
148148
149149 pub fn calculate_buffer_name(&self) -> String {
150150 let room = self.room();
151 let room_name = room.calculate_name();
151 let room_name = room.display_name();
152152
153153 if room_name == "#" {
154154 "##".to_owned()
src/server.rs +7 −7
@@ -69,7 +69,7 @@ use matrix_sdk::{
6969 room::message::{MessageEventContent, TextMessageEventContent},
7070 },
7171 identifiers::{RoomId, UserId},
72 AsyncClient, AsyncClientConfig, SyncSettings,
72 Client, ClientConfig, SyncSettings,
7373};
7474
7575use weechat::config::{
@@ -149,7 +149,7 @@ pub(crate) struct InnerServer {
149149 room_buffers: HashMap<RoomId, RoomBuffer>,
150150 settings: ServerSettings,
151151 config: Config,
152 client: Option<AsyncClient>,
152 client: Option<Client>,
153153 login_state: Option<LoginState>,
154154 connected_state: Rc<RefCell<Option<Connection>>>,
155155}
@@ -414,13 +414,13 @@ impl InnerServer {
414414 self.login_state = Some(login_state);
415415 }
416416
417 pub fn create_client(&mut self) -> Result<AsyncClient, ServerError> {
417 pub fn create_client(&mut self) -> Result<Client, ServerError> {
418418 let homeserver =
419419 self.settings.homeserver.as_ref().ok_or_else(|| {
420420 ServerError::StartError("Homeserver not configured".to_owned())
421421 })?;
422422
423 let mut client_config = AsyncClientConfig::new();
423 let mut client_config = ClientConfig::new();
424424
425425 if let Some(proxy) = &self.settings.proxy {
426426 client_config = client_config
@@ -429,7 +429,7 @@ impl InnerServer {
429429 .disable_ssl_verification();
430430 }
431431
432 let client = AsyncClient::new_with_config(
432 let client = Client::new_with_config(
433433 homeserver.clone(),
434434 None,
435435 client_config,
@@ -522,7 +522,7 @@ impl MatrixServer {
522522 /// This runs on the per server tokio executor.
523523 /// It communicates with the main Weechat thread using a async channel.
524524 pub async fn sync_loop(
525 client: AsyncClient,
525 client: Client,
526526 channel: Sender<Result<ThreadMessage, String>>,
527527 username: String,
528528 password: String,
@@ -629,7 +629,7 @@ impl MatrixServer {
629629 /// Send loop that waits for requests that need to be sent out using our
630630 /// Matrix client.
631631 pub async fn send_loop(
632 client: AsyncClient,
632 client: Client,
633633 channel: Receiver<ServerMessage>,
634634 ) {
635635 while let Some(message) = channel.recv().await {