mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 23:13:11 -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.
|
// 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?
|
// TODO: maybe have QuerySenderIDForUser return richer errors?
|
||||||
var queryResp roomserverAPI.QueryMembershipForUserResponse
|
var queryResp roomserverAPI.QueryMembershipForUserResponse
|
||||||
rsAPI.QueryMembershipForUser(req.Context(), &roomserverAPI.QueryMembershipForUserRequest{
|
err = rsAPI.QueryMembershipForUser(req.Context(), &roomserverAPI.QueryMembershipForUserRequest{
|
||||||
RoomID: validRoomID.String(),
|
RoomID: validRoomID.String(),
|
||||||
UserID: *userID,
|
UserID: *userID,
|
||||||
}, &queryResp)
|
}, &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 {
|
if !queryResp.IsInRoom {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ func (r *Upgrader) performRoomUpgrade(
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Move local aliases to the new room
|
// 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
|
return "", pErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ func (r *Upgrader) restrictOldRoomPowerLevels(ctx context.Context, evTime time.T
|
||||||
}
|
}
|
||||||
|
|
||||||
func moveLocalAliases(ctx context.Context,
|
func moveLocalAliases(ctx context.Context,
|
||||||
roomID, newRoomID string, senderID spec.SenderID, userID spec.UserID,
|
roomID, newRoomID string, senderID spec.SenderID,
|
||||||
URSAPI api.RoomserverInternalAPI,
|
URSAPI api.RoomserverInternalAPI,
|
||||||
) (err error) {
|
) (err error) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue