mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-17 02:38:18 -07:00
improvement: add room topic to public room dir
This commit is contained in:
parent
e0fccffde0
commit
8df2a1a072
@ -1203,7 +1203,11 @@ pub async fn get_public_rooms_route(
|
|||||||
.map(|n| n.to_owned()),
|
.map(|n| n.to_owned()),
|
||||||
num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(),
|
num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(),
|
||||||
room_id,
|
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,
|
world_readable: false,
|
||||||
guest_can_join: true,
|
guest_can_join: true,
|
||||||
avatar_url: None,
|
avatar_url: None,
|
||||||
@ -1243,7 +1247,11 @@ pub async fn get_public_rooms_filtered_route(
|
|||||||
.map(|n| n.to_owned()),
|
.map(|n| n.to_owned()),
|
||||||
num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(),
|
num_joined_members: (db.rooms.room_members(&room_id).count() as u32).into(),
|
||||||
room_id,
|
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,
|
world_readable: false,
|
||||||
guest_can_join: true,
|
guest_can_join: true,
|
||||||
avatar_url: None,
|
avatar_url: None,
|
||||||
|
Loading…
Reference in New Issue
Block a user