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