Commit 8c3d805f25
Unsigned
Layout: unified · split
src/commands/topic.rs +10 −8
| @@ -33,14 +33,16 @@ impl TopicCommand { | ||
| 33 | 33 | if let Some(room) = self.servers.find_room(buffer) { |
| 34 | 34 | let room = room.room().clone(); |
| 35 | 35 | |
| 36 | match self.servers.runtime().block_on(room.set_room_topic(&topic)) { | |
| 37 | Ok(_) => (), | |
| 38 | Err(error) => Weechat::print(&format!( | |
| 39 | "{}Failed to set room topic: {}", | |
| 40 | Weechat::prefix(Prefix::Error), | |
| 41 | error | |
| 42 | )), | |
| 43 | } | |
| 36 | Weechat::spawn(async move { | |
| 37 | if let Err(error) = room.set_room_topic(&topic).await { | |
| 38 | Weechat::print(&format!( | |
| 39 | "{}Failed to set room topic: {}", | |
| 40 | Weechat::prefix(Prefix::Error), | |
| 41 | error | |
| 42 | )); | |
| 43 | } | |
| 44 | }) | |
| 45 | .detach(); | |
| 44 | 46 | } else { |
| 45 | 47 | Weechat::print( |
| 46 | 48 | "The /topic command needs to be run in a Matrix room buffer.", |