Commit 70c6dd5e61

70c6dd5e61f0f633e68b5708fa4c5577be10718c

parent: 31f8e04503

Unsigned

Darafei Praliaskouski <me@komzpa.net> · 2026-07-10 14:28 UTC
committer: <strk@kbt.io>

fix: run redactions asynchronously

Layout: unified · split

src/commands/redact.rs +13 −13
@@ -93,19 +93,19 @@ impl RedactCommand {
93 if let Some(room) = self.servers.find_room(buffer) { 93 if let Some(room) = self.servers.find_room(buffer) {
94 let room = room.room().clone(); 94 let room = room.room().clone();
95 95
96 match self.servers.runtime().block_on(room.redact( 96 Weechat::spawn(async move {
97 &event_id, 97 if let Err(error) =
98 reason.as_deref(), 98 room.redact(&event_id, reason.as_deref(), None).await
99 None, 99 {
100 )) { 100 Weechat::print(&format!(
101 Ok(_) => (), 101 "{}Failed to redact {}: {}",
102 Err(error) => Weechat::print(&format!( 102 Weechat::prefix(Prefix::Error),
103 "{}Failed to redact {}: {}", 103 event_id,
104 Weechat::prefix(Prefix::Error), 104 error
105 event_id, 105 ));
106 error 106 }
107 )), 107 })
108 } 108 .detach();
109 } else { 109 } else {
110 Weechat::print( 110 Weechat::print(
111 "The /redact command needs to be run in a Matrix room buffer.", 111 "The /redact command needs to be run in a Matrix room buffer.",