tuwunel_admin/room/info/view_room_topic.rs
1use ruma::OwnedRoomId;
2use tuwunel_core::{Err, Result};
3
4use crate::admin_command;
5
6#[admin_command]
7pub(super) async fn view_room_topic(&self, room_id: OwnedRoomId) -> Result {
8 let Ok(room_topic) = self
9 .services
10 .state_accessor
11 .get_room_topic(&room_id)
12 .await
13 else {
14 return Err!("Room does not have a room topic set.");
15 };
16
17 write!(self, "Room topic:\n```\n{room_topic}\n```").await
18}