Commit 8c3d805f25

8c3d805f25f620c7137ce3d35839a11e91678a55

parent: 65cc837eb9

Unsigned

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

fix: set room topics asynchronously

Layout: unified · split

src/commands/topic.rs +10 −8
@@ -33,14 +33,16 @@ impl TopicCommand {
3333 if let Some(room) = self.servers.find_room(buffer) {
3434 let room = room.room().clone();
3535
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();
4446 } else {
4547 Weechat::print(
4648 "The /topic command needs to be run in a Matrix room buffer.",