mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 21:12:45 +00:00
parent
8c721b555e
commit
94ea325c93
6 changed files with 135 additions and 14 deletions
|
@ -62,6 +62,18 @@ type GetAliasesForRoomIDResponse struct {
|
|||
Aliases []string `json:"aliases"`
|
||||
}
|
||||
|
||||
// GetCreatorIDForAliasRequest is a request to GetCreatorIDForAlias
|
||||
type GetCreatorIDForAliasRequest struct {
|
||||
// The alias we want to find the creator of
|
||||
Alias string `json:"alias"`
|
||||
}
|
||||
|
||||
// GetCreatorIDForAliasResponse is a response to GetCreatorIDForAlias
|
||||
type GetCreatorIDForAliasResponse struct {
|
||||
// The user ID of the alias creator
|
||||
UserID string `json:"user_id"`
|
||||
}
|
||||
|
||||
// RemoveRoomAliasRequest is a request to RemoveRoomAlias
|
||||
type RemoveRoomAliasRequest struct {
|
||||
// ID of the user removing the alias
|
||||
|
@ -96,6 +108,13 @@ type RoomserverAliasAPI interface {
|
|||
response *GetAliasesForRoomIDResponse,
|
||||
) error
|
||||
|
||||
// Get the user ID of the creator of an alias
|
||||
GetCreatorIDForAlias(
|
||||
ctx context.Context,
|
||||
req *GetCreatorIDForAliasRequest,
|
||||
response *GetCreatorIDForAliasResponse,
|
||||
) error
|
||||
|
||||
// Remove a room alias
|
||||
RemoveRoomAlias(
|
||||
ctx context.Context,
|
||||
|
@ -113,6 +132,9 @@ const RoomserverGetRoomIDForAliasPath = "/api/roomserver/GetRoomIDForAlias"
|
|||
// RoomserverGetAliasesForRoomIDPath is the HTTP path for the GetAliasesForRoomID API.
|
||||
const RoomserverGetAliasesForRoomIDPath = "/api/roomserver/GetAliasesForRoomID"
|
||||
|
||||
// RoomserverGetCreatorIDForAliasPath is the HTTP path for the GetCreatorIDForAlias API.
|
||||
const RoomserverGetCreatorIDForAliasPath = "/api/roomserver/GetCreatorIDForAlias"
|
||||
|
||||
// RoomserverRemoveRoomAliasPath is the HTTP path for the RemoveRoomAlias API.
|
||||
const RoomserverRemoveRoomAliasPath = "/api/roomserver/removeRoomAlias"
|
||||
|
||||
|
@ -169,6 +191,19 @@ func (h *httpRoomserverAliasAPI) GetAliasesForRoomID(
|
|||
return commonHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
|
||||
}
|
||||
|
||||
// GetCreatorIDForAlias implements RoomserverAliasAPI
|
||||
func (h *httpRoomserverAliasAPI) GetCreatorIDForAlias(
|
||||
ctx context.Context,
|
||||
request *GetCreatorIDForAliasRequest,
|
||||
response *GetCreatorIDForAliasResponse,
|
||||
) error {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "GetCreatorIDForAlias")
|
||||
defer span.Finish()
|
||||
|
||||
apiURL := h.roomserverURL + RoomserverGetCreatorIDForAliasPath
|
||||
return commonHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
|
||||
}
|
||||
|
||||
// RemoveRoomAlias implements RoomserverAliasAPI
|
||||
func (h *httpRoomserverAliasAPI) RemoveRoomAlias(
|
||||
ctx context.Context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue