Commit 837814f544

837814f54447813efc77a44b78111a4243ac0884

parent: ea5537e287

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-07-18 15:48 UTC

weechat-matrix: Update the command creation.

Layout: unified · split

Cargo.lock +3 −3
@@ -2203,7 +2203,7 @@ dependencies = [
22032203[[package]]
22042204name = "weechat"
22052205version = "0.1.0"
2206source = "git+https://github.com/poljar/rust-weechat#7defc24d659aa920d519f47e7cb25982926647a9"
2206source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982"
22072207dependencies = [
22082208 "async-task",
22092209 "async-trait",
@@ -2219,7 +2219,7 @@ dependencies = [
22192219[[package]]
22202220name = "weechat-macro"
22212221version = "0.1.0"
2222source = "git+https://github.com/poljar/rust-weechat#7defc24d659aa920d519f47e7cb25982926647a9"
2222source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982"
22232223dependencies = [
22242224 "libc",
22252225 "proc-macro2",
@@ -2246,7 +2246,7 @@ dependencies = [
22462246[[package]]
22472247name = "weechat-sys"
22482248version = "0.1.0"
2249source = "git+https://github.com/poljar/rust-weechat#7defc24d659aa920d519f47e7cb25982926647a9"
2249source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982"
22502250dependencies = [
22512251 "bindgen",
22522252 "libc",
src/commands.rs +3 −4
@@ -267,7 +267,6 @@ impl CommandCallback for MatrixCommand {
267267
268268impl Commands {
269269 pub fn hook_all(
270 weechat: &Weechat,
271270 servers: &Servers,
272271 config: &ConfigHandle,
273272 ) -> Result<Commands, ()> {
@@ -293,14 +292,14 @@ Use /matrix [command] help to find out more.\n",
293292 .add_completion("reconnect")
294293 .add_completion("help server|connect|disconnect|reconnect");
295294
296 let matrix = weechat.hook_command(
295 let matrix = Command::new(
297296 matrix_settings,
298297 MatrixCommand {
299298 servers: servers.clone(),
300299 config: config.clone(),
301300 },
302 );
301 )?;
303302
304 Ok(Commands { _matrix: matrix? })
303 Ok(Commands { _matrix: matrix })
305304 }
306305}
src/lib.rs +2 −2
@@ -137,10 +137,10 @@ impl BarItemCallback for Servers {
137137}
138138
139139impl WeechatPlugin for Matrix {
140 fn init(weechat: &Weechat, _args: ArgsWeechat) -> Result<Self, ()> {
140 fn init(_: &Weechat, _args: ArgsWeechat) -> Result<Self, ()> {
141141 let servers = Servers::new();
142142 let config = ConfigHandle::new(&servers);
143 let commands = Commands::hook_all(weechat, &servers, &config)?;
143 let commands = Commands::hook_all(&servers, &config)?;
144144
145145 // TODO move the bar creation into a separate file.
146146 let status_bar =