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 {
33 if let Some(room) = self.servers.find_room(buffer) { 33 if let Some(room) = self.servers.find_room(buffer) {
34 let room = room.room().clone(); 34 let room = room.room().clone();
35 35
36 match self.servers.runtime().block_on(room.set_room_topic(&topic)) { 36 Weechat::spawn(async move {
37 Ok(_) => (), 37 if let Err(error) = room.set_room_topic(&topic).await {
38 Err(error) => Weechat::print(&format!( 38 Weechat::print(&format!(
39 "{}Failed to set room topic: {}", 39 "{}Failed to set room topic: {}",
40 Weechat::prefix(Prefix::Error), 40 Weechat::prefix(Prefix::Error),
41 error 41 error
42 )), 42 ));
43 } 43 }
44 })
45 .detach();
44 } else { 46 } else {
45 Weechat::print( 47 Weechat::print(
46 "The /topic command needs to be run in a Matrix room buffer.", 48 "The /topic command needs to be run in a Matrix room buffer.",