diff options
author | Kegsay <kegan@matrix.org> | 2020-06-10 10:34:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 10:34:22 +0100 |
commit | 98cb0705eab07233cbc78fbe4342e1b1890c2a60 (patch) | |
tree | 66fe1d58d6926c0b477ddc507571503eb5d2e9c3 /clientapi/routing/profile.go | |
parent | 85ac8a3f5ba407ece584843a4d77466c1c4f5565 (diff) |
Remove unused UserUpdates producer (#1109)
Diffstat (limited to 'clientapi/routing/profile.go')
-rw-r--r-- | clientapi/routing/profile.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/clientapi/routing/profile.go b/clientapi/routing/profile.go index dbf6ef1d..c0fe32a3 100644 --- a/clientapi/routing/profile.go +++ b/clientapi/routing/profile.go @@ -94,7 +94,7 @@ func GetAvatarURL( // nolint:gocyclo func SetAvatarURL( req *http.Request, accountDB accounts.Database, device *authtypes.Device, - userID string, producer *producers.UserUpdateProducer, cfg *config.Dendrite, + userID string, cfg *config.Dendrite, rsProducer *producers.RoomserverProducer, rsAPI api.RoomserverInternalAPI, ) util.JSONResponse { if userID != device.UserID { @@ -104,8 +104,6 @@ func SetAvatarURL( } } - changedKey := "avatar_url" - var r internal.AvatarURL if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil { return *resErr @@ -174,11 +172,6 @@ func SetAvatarURL( return jsonerror.InternalServerError() } - if err := producer.SendUpdate(userID, changedKey, oldProfile.AvatarURL, r.AvatarURL); err != nil { - util.GetLogger(req.Context()).WithError(err).Error("producer.SendUpdate failed") - return jsonerror.InternalServerError() - } - return util.JSONResponse{ Code: http.StatusOK, JSON: struct{}{}, @@ -216,7 +209,7 @@ func GetDisplayName( // nolint:gocyclo func SetDisplayName( req *http.Request, accountDB accounts.Database, device *authtypes.Device, - userID string, producer *producers.UserUpdateProducer, cfg *config.Dendrite, + userID string, cfg *config.Dendrite, rsProducer *producers.RoomserverProducer, rsAPI api.RoomserverInternalAPI, ) util.JSONResponse { if userID != device.UserID { @@ -226,8 +219,6 @@ func SetDisplayName( } } - changedKey := "displayname" - var r internal.DisplayName if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil { return *resErr @@ -296,11 +287,6 @@ func SetDisplayName( return jsonerror.InternalServerError() } - if err := producer.SendUpdate(userID, changedKey, oldProfile.DisplayName, r.DisplayName); err != nil { - util.GetLogger(req.Context()).WithError(err).Error("producer.SendUpdate failed") - return jsonerror.InternalServerError() - } - return util.JSONResponse{ Code: http.StatusOK, JSON: struct{}{}, |