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