Skip to content
Snippets Groups Projects
Unverified Commit b82d68c0 authored by Tulir Asokan's avatar Tulir Asokan Committed by GitHub
Browse files

Add the topic and avatar to the room details admin API (#8305)

parent 6605470b
No related branches found
No related tags found
No related merge requests found
Add the room topic and avatar to the room details admin API.
...@@ -275,6 +275,8 @@ The following fields are possible in the JSON response body: ...@@ -275,6 +275,8 @@ The following fields are possible in the JSON response body:
* `room_id` - The ID of the room. * `room_id` - The ID of the room.
* `name` - The name of the room. * `name` - The name of the room.
* `topic` - The topic of the room.
* `avatar` - The `mxc` URI to the avatar of the room.
* `canonical_alias` - The canonical (main) alias address of the room. * `canonical_alias` - The canonical (main) alias address of the room.
* `joined_members` - How many users are currently in the room. * `joined_members` - How many users are currently in the room.
* `joined_local_members` - How many local users are currently in the room. * `joined_local_members` - How many local users are currently in the room.
...@@ -304,6 +306,8 @@ Response: ...@@ -304,6 +306,8 @@ Response:
{ {
"room_id": "!mscvqgqpHYjBGDxNym:matrix.org", "room_id": "!mscvqgqpHYjBGDxNym:matrix.org",
"name": "Music Theory", "name": "Music Theory",
"avatar": "mxc://matrix.org/AQDaVFlbkQoErdOgqWRgiGSV",
"topic": "Theory, Composition, Notation, Analysis",
"canonical_alias": "#musictheory:matrix.org", "canonical_alias": "#musictheory:matrix.org",
"joined_members": 127 "joined_members": 127
"joined_local_members": 2, "joined_local_members": 2,
......
...@@ -104,7 +104,8 @@ class RoomWorkerStore(SQLBaseStore): ...@@ -104,7 +104,8 @@ class RoomWorkerStore(SQLBaseStore):
curr.local_users_in_room AS joined_local_members, rooms.room_version AS version, curr.local_users_in_room AS joined_local_members, rooms.room_version AS version,
rooms.creator, state.encryption, state.is_federatable AS federatable, rooms.creator, state.encryption, state.is_federatable AS federatable,
rooms.is_public AS public, state.join_rules, state.guest_access, rooms.is_public AS public, state.join_rules, state.guest_access,
state.history_visibility, curr.current_state_events AS state_events state.history_visibility, curr.current_state_events AS state_events,
state.avatar, state.topic
FROM rooms FROM rooms
LEFT JOIN room_stats_state state USING (room_id) LEFT JOIN room_stats_state state USING (room_id)
LEFT JOIN room_stats_current curr USING (room_id) LEFT JOIN room_stats_current curr USING (room_id)
......
...@@ -1174,6 +1174,8 @@ class RoomTestCase(unittest.HomeserverTestCase): ...@@ -1174,6 +1174,8 @@ class RoomTestCase(unittest.HomeserverTestCase):
self.assertIn("room_id", channel.json_body) self.assertIn("room_id", channel.json_body)
self.assertIn("name", channel.json_body) self.assertIn("name", channel.json_body)
self.assertIn("topic", channel.json_body)
self.assertIn("avatar", channel.json_body)
self.assertIn("canonical_alias", channel.json_body) self.assertIn("canonical_alias", channel.json_body)
self.assertIn("joined_members", channel.json_body) self.assertIn("joined_members", channel.json_body)
self.assertIn("joined_local_members", channel.json_body) self.assertIn("joined_local_members", channel.json_body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment