mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 18:13:09 -06:00
Properly lookup userID when removing room alias
This commit is contained in:
parent
c0be935e59
commit
c2aac0f19e
|
|
@ -119,11 +119,6 @@ func (r *RoomserverInternalAPI) RemoveRoomAlias(
|
||||||
request *api.RemoveRoomAliasRequest,
|
request *api.RemoveRoomAliasRequest,
|
||||||
response *api.RemoveRoomAliasResponse,
|
response *api.RemoveRoomAliasResponse,
|
||||||
) error {
|
) error {
|
||||||
_, virtualHost, err := r.Cfg.Global.SplitLocalID('@', request.SenderID)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
roomID, err := r.DB.GetRoomIDForAlias(ctx, request.Alias)
|
roomID, err := r.DB.GetRoomIDForAlias(ctx, request.Alias)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("r.DB.GetRoomIDForAlias: %w", err)
|
return fmt.Errorf("r.DB.GetRoomIDForAlias: %w", err)
|
||||||
|
|
@ -134,6 +129,12 @@ func (r *RoomserverInternalAPI) RemoveRoomAlias(
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sender, err := r.QueryUserIDForSender(ctx, roomID, request.SenderID)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("r.QueryUserIDForSender: %w", err)
|
||||||
|
}
|
||||||
|
virtualHost := sender.Domain()
|
||||||
|
|
||||||
response.Found = true
|
response.Found = true
|
||||||
creatorID, err := r.DB.GetCreatorIDForAlias(ctx, request.Alias)
|
creatorID, err := r.DB.GetCreatorIDForAlias(ctx, request.Alias)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue