Skip to content

Commit d24b276

Browse files
author
ghuet
committed
add GetRoomDetails function to admin api
1 parent 4b970e0 commit d24b276

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: synapseadmin/roomapi.go

+11
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,14 @@ func (cli *Client) GetRoomBlockStatus(ctx context.Context, roomID id.RoomID) (Ro
202202
_, err := cli.MakeRequest(ctx, http.MethodGet, reqURL, nil, &resp)
203203
return resp, err
204204
}
205+
206+
// ListRooms returns a list of rooms on the server.
207+
//
208+
// https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#list-room-api
209+
func (cli *Client) GetRoomDetails(ctx context.Context, roomID id.RoomID) (RoomInfo, error) {
210+
var resp RoomInfo
211+
var reqURL string
212+
reqURL = cli.BuildURLWithQuery(mautrix.SynapseAdminURLPath{"v1", "rooms", roomID}, nil)
213+
_, err := cli.MakeRequest(ctx, http.MethodGet, reqURL, nil, &resp)
214+
return resp, err
215+
}

0 commit comments

Comments
 (0)