diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index f077e48d5..e1bb1555c 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -965,9 +965,10 @@ func completeRegistration( // TODO-entry refuse register if threepid is already bound to account. if threePid != nil { err = userAPI.PerformSaveThreePIDAssociation(ctx, &userapi.PerformSaveThreePIDAssociationRequest{ - Medium: threePid.Medium, - ThreePID: threePid.Address, - Localpart: accRes.Account.Localpart, + Medium: threePid.Medium, + ThreePID: threePid.Address, + Localpart: accRes.Account.Localpart, + ServerName: accRes.Account.ServerName, }, &struct{}{}) if err != nil { return util.JSONResponse{ diff --git a/syncapi/sync/request.go b/syncapi/sync/request.go index 6a97e25bc..e5e5fdb5b 100644 --- a/syncapi/sync/request.go +++ b/syncapi/sync/request.go @@ -80,8 +80,6 @@ func newSyncRequest(req *http.Request, device userapi.Device, syncDB storage.Dat filter.AccountData.Limit = math.MaxInt32 filter.Room.AccountData.Limit = math.MaxInt32 } - // Ignore state limit filter so that e.g. correct room name appears on clients. - filter.Room.State.Limit = math.MaxInt32 logger := util.GetLogger(req.Context()).WithFields(logrus.Fields{ "user_id": device.UserID, diff --git a/userapi/internal/api.go b/userapi/internal/api.go index 7f30449e5..bde6707b7 100644 --- a/userapi/internal/api.go +++ b/userapi/internal/api.go @@ -625,7 +625,7 @@ func (a *UserInternalAPI) PerformAccountDeactivation(ctx context.Context, req *a return err } - threepids, err := a.DB.GetThreePIDsForLocalpart(ctx, req.Localpart) + threepids, err := a.DB.GetThreePIDsForLocalpart(ctx, req.Localpart, serverName) if err != nil { return err }