From 8df2a1a072e75d4c56a625e0c55bae6e5646f1cd Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 20 May 2020 00:12:07 +0200 Subject: [PATCH] improvement: add room topic to public room dir --- src/client_server.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client_server.rs b/src/client_server.rs index e521624b..bc0af79f 100644 --- a/src/client_server.rs +++ b/src/client_server.rs @@ -1203,7 +1203,11 @@ pub async fn get_public_rooms_route( .map(|n| n.to_owned()), num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(), room_id, - topic: None, + topic: state + .get(&(EventType::RoomTopic, "".to_owned())) + .and_then(|s| s.content.get("topic")) + .and_then(|n| n.as_str()) + .map(|n| n.to_owned()), world_readable: false, guest_can_join: true, avatar_url: None, @@ -1243,7 +1247,11 @@ pub async fn get_public_rooms_filtered_route( .map(|n| n.to_owned()), num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(), room_id, - topic: None, + topic: state + .get(&(EventType::RoomTopic, "".to_owned())) + .and_then(|s| s.content.get("topic")) + .and_then(|n| n.as_str()) + .map(|n| n.to_owned()), world_readable: false, guest_can_join: true, avatar_url: None,