Commit 1d27f59d36

1d27f59d36a70c4db95c702e17d46b851fa7cfde

parent: 69203b09bc

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2021-01-03 15:44 UTC

weechat-matrix: Formatting fixes.

Layout: unified · split

src/bar_items/status.rs +1 −3
@@ -31,9 +31,7 @@ impl BarItemCallback for Status {
3131 }
3232
3333 if room.is_busy() {
34 signs.push(
35 server.config().borrow().look().busy_sign(),
36 );
34 signs.push(server.config().borrow().look().busy_sign());
3735 }
3836 }
3937
src/connection.rs +7 −2
@@ -43,7 +43,10 @@ use matrix_sdk::{
4343
4444use weechat::{Task, Weechat};
4545
46use crate::{room::PrevBatch, server::{InnerServer, MatrixServer}};
46use crate::{
47 room::PrevBatch,
48 server::{InnerServer, MatrixServer},
49};
4750
4851const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30);
4952pub const TYPING_NOTICE_TIMEOUT: Duration = Duration::from_secs(4);
@@ -209,7 +212,9 @@ impl Connection {
209212
210213 self.spawn(async move {
211214 let request = match &prev_batch {
212 PrevBatch::Backwards(t) => MessagesRequest::backward(&room_id, &t),
215 PrevBatch::Backwards(t) => {
216 MessagesRequest::backward(&room_id, &t)
217 }
213218 PrevBatch::Forward(t) => MessagesRequest::forward(&room_id, &t),
214219 };
215220
src/lib.rs +10 −6
@@ -75,7 +75,9 @@ impl Servers {
7575 }
7676
7777 pub fn insert(&self, server: MatrixServer) {
78 self.0.borrow_mut().insert(server.name().to_string(), server);
78 self.0
79 .borrow_mut()
80 .insert(server.name().to_string(), server);
7981 }
8082
8183 pub fn get(&self, server_name: &str) -> Option<MatrixServer> {
@@ -177,10 +179,7 @@ impl Matrix {
177179 }
178180 }
179181
180 fn create_default_server(
181 servers: Servers,
182 config: &ConfigHandle,
183 ) {
182 fn create_default_server(servers: Servers, config: &ConfigHandle) {
184183 // TODO change this to matrix.org.
185184 let server_name = "localhost";
186185
@@ -189,7 +188,12 @@ impl Matrix {
189188 .search_section_mut("server")
190189 .expect("Can't get server section");
191190
192 let server = MatrixServer::new(server_name, config, &mut section, servers.clone());
191 let server = MatrixServer::new(
192 server_name,
193 config,
194 &mut section,
195 servers.clone(),
196 );
193197 servers.insert(server);
194198 }
195199}