Commit 70c6dd5e61
Unsigned
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.", |