From d24b2761997f7eb34d081834cc8b02f0b09ffe1f Mon Sep 17 00:00:00 2001 From: ghuet Date: Wed, 27 Nov 2024 10:56:56 +0100 Subject: [PATCH] add GetRoomDetails function to admin api --- synapseadmin/roomapi.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/synapseadmin/roomapi.go b/synapseadmin/roomapi.go index 6c072e23..27a34dc8 100644 --- a/synapseadmin/roomapi.go +++ b/synapseadmin/roomapi.go @@ -202,3 +202,14 @@ func (cli *Client) GetRoomBlockStatus(ctx context.Context, roomID id.RoomID) (Ro _, err := cli.MakeRequest(ctx, http.MethodGet, reqURL, nil, &resp) return resp, err } + +// ListRooms returns a list of rooms on the server. +// +// https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#list-room-api +func (cli *Client) GetRoomDetails(ctx context.Context, roomID id.RoomID) (RoomInfo, error) { + var resp RoomInfo + var reqURL string + reqURL = cli.BuildURLWithQuery(mautrix.SynapseAdminURLPath{"v1", "rooms", roomID}, nil) + _, err := cli.MakeRequest(ctx, http.MethodGet, reqURL, nil, &resp) + return resp, err +}