mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
lint pass
- handled unhandled err in RemoveLocalAlias - removed unused argument from moveLocalAliases
This commit is contained in:
parent
4b09bed827
commit
8f2153d3e6
|
|
@ -274,10 +274,17 @@ func RemoveLocalAlias(
|
|||
// as meaning they are not in the room, since lacking a sender ID could be caused by other bugs.
|
||||
// TODO: maybe have QuerySenderIDForUser return richer errors?
|
||||
var queryResp roomserverAPI.QueryMembershipForUserResponse
|
||||
rsAPI.QueryMembershipForUser(req.Context(), &roomserverAPI.QueryMembershipForUserRequest{
|
||||
err = rsAPI.QueryMembershipForUser(req.Context(), &roomserverAPI.QueryMembershipForUserRequest{
|
||||
RoomID: validRoomID.String(),
|
||||
UserID: *userID,
|
||||
}, &queryResp)
|
||||
if err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("roomserverAPI.QueryMembershipForUser failed")
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: spec.Unknown("internal server error"),
|
||||
}
|
||||
}
|
||||
if !queryResp.IsInRoom {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusForbidden,
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ func (r *Upgrader) performRoomUpgrade(
|
|||
}
|
||||
|
||||
// 4. Move local aliases to the new room
|
||||
if pErr = moveLocalAliases(ctx, roomID, newRoomID, senderID, userID, r.URSAPI); pErr != nil {
|
||||
if pErr = moveLocalAliases(ctx, roomID, newRoomID, senderID, r.URSAPI); pErr != nil {
|
||||
return "", pErr
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ func (r *Upgrader) restrictOldRoomPowerLevels(ctx context.Context, evTime time.T
|
|||
}
|
||||
|
||||
func moveLocalAliases(ctx context.Context,
|
||||
roomID, newRoomID string, senderID spec.SenderID, userID spec.UserID,
|
||||
roomID, newRoomID string, senderID spec.SenderID,
|
||||
URSAPI api.RoomserverInternalAPI,
|
||||
) (err error) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue