Skip to content

Commit

Permalink
add GetRoomDetails function to admin api
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuet committed Nov 27, 2024
1 parent 4b970e0 commit da2cf67
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions synapseadmin/roomapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,18 @@ 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.MakeFullRequest(ctx, mautrix.FullRequest{
Method: http.MethodGet,
URL: reqURL,
ResponseJSON: &resp,
})
return resp, err
}

0 comments on commit da2cf67

Please sign in to comment.