Commit 9dd8781f26
9dd8781f26cbda32cbccf85605ce19e51e56db37
parent: 837814f544
Unsigned
Damir Jelić <poljar@termina.org.uk> · 2020-07-19 13:06 UTC
weechat-matrix: Update for the latest rust-weechat changes.
Layout: unified · split
Cargo.lock
+6 −6
| @@ -2202,8 +2202,8 @@ dependencies = [ |
| 2202 | 2202 | |
| 2203 | 2203 | [[package]] |
| 2204 | 2204 | name = "weechat" |
| 2205 | | version = "0.1.0" |
| 2206 | | source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982" |
| 2205 | version = "0.2.3" |
| 2206 | source = "git+https://github.com/poljar/rust-weechat#6ce949f88fa2f88af245d47a7bb3392b1274c265" |
| 2207 | 2207 | dependencies = [ |
| 2208 | 2208 | "async-task", |
| 2209 | 2209 | "async-trait", |
| @@ -2218,8 +2218,8 @@ dependencies = [ |
| 2218 | 2218 | |
| 2219 | 2219 | [[package]] |
| 2220 | 2220 | name = "weechat-macro" |
| 2221 | | version = "0.1.0" |
| 2222 | | source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982" |
| 2221 | version = "0.2.0" |
| 2222 | source = "git+https://github.com/poljar/rust-weechat#6ce949f88fa2f88af245d47a7bb3392b1274c265" |
| 2223 | 2223 | dependencies = [ |
| 2224 | 2224 | "libc", |
| 2225 | 2225 | "proc-macro2", |
| @@ -2245,8 +2245,8 @@ dependencies = [ |
| 2245 | 2245 | |
| 2246 | 2246 | [[package]] |
| 2247 | 2247 | name = "weechat-sys" |
| 2248 | | version = "0.1.0" |
| 2249 | | source = "git+https://github.com/poljar/rust-weechat#18675e3fafee2ddcd4e682e4b9d1768e8cfed982" |
| 2248 | version = "0.2.0" |
| 2249 | source = "git+https://github.com/poljar/rust-weechat#6ce949f88fa2f88af245d47a7bb3392b1274c265" |
| 2250 | 2250 | dependencies = [ |
| 2251 | 2251 | "bindgen", |
| 2252 | 2252 | "libc", |
Cargo.toml
+1 −1
| @@ -21,7 +21,7 @@ uuid = { version = "0.8.1", features = ["v4"] } |
| 21 | 21 | |
| 22 | 22 | [dependencies.weechat] |
| 23 | 23 | git = "https://github.com/poljar/rust-weechat" |
| 24 | | features = ["async-executor", "config-macro"] |
| 24 | features = ["async", "config_macro"] |
| 25 | 25 | |
| 26 | 26 | [dependencies.matrix-sdk] |
| 27 | 27 | git = "https://github.com/matrix-org/matrix-rust-sdk/" |
Makefile
+1 −1
| @@ -3,7 +3,7 @@ PREFIX ?= $(WEECHAT_HOME) |
| 3 | 3 | |
| 4 | 4 | .PHONY: install install-dir phony lint |
| 5 | 5 | |
| 6 | | target/debug/libmatrix.so: src/lib.rs src/server.rs src/room_buffer.rs src/commands.rs src/config.rs src/config_macros.rs |
| 6 | target/debug/libmatrix.so: src/lib.rs src/server.rs src/room_buffer.rs src/commands.rs src/config.rs |
| 7 | 7 | cargo build |
| 8 | 8 | |
| 9 | 9 | install: install-dir target/debug/libmatrix.so |
src/lib.rs
+3 −6
| @@ -12,9 +12,7 @@ use std::rc::Rc; |
| 12 | 12 | |
| 13 | 13 | use weechat::{ |
| 14 | 14 | buffer::{Buffer, BufferHandle}, |
| 15 | | hooks::{ |
| 16 | | BarItemCallback, BarItemHandle, SignalCallback, SignalData, SignalHook, |
| 17 | | }, |
| 15 | hooks::{BarItem, BarItemCallback, SignalCallback, SignalData, SignalHook}, |
| 18 | 16 | weechat_plugin, ArgsWeechat, ReturnCode, Weechat, WeechatPlugin, |
| 19 | 17 | }; |
| 20 | 18 | |
| @@ -74,7 +72,7 @@ struct Matrix { |
| 74 | 72 | #[used] |
| 75 | 73 | config: ConfigHandle, |
| 76 | 74 | #[used] |
| 77 | | status_bar: BarItemHandle, |
| 75 | status_bar: BarItem, |
| 78 | 76 | #[used] |
| 79 | 77 | typing_notice_signal: SignalHook, |
| 80 | 78 | debug_buffer: RefCell<Option<BufferHandle>>, |
| @@ -143,8 +141,7 @@ impl WeechatPlugin for Matrix { |
| 143 | 141 | let commands = Commands::hook_all(&servers, &config)?; |
| 144 | 142 | |
| 145 | 143 | // TODO move the bar creation into a separate file. |
| 146 | | let status_bar = |
| 147 | | Weechat::new_bar_item("matrix_modes", servers.clone())?; |
| 144 | let status_bar = BarItem::new("matrix_modes", servers.clone())?; |
| 148 | 145 | |
| 149 | 146 | tracing_subscriber::fmt() |
| 150 | 147 | .with_writer(debug::Debug) |