Skip to content

Commit

Permalink
Fix setting displayname and avatar_url (#3125)
Browse files Browse the repository at this point in the history
As per the spec, `displayname` and `avatar_url` may be empty.
  • Loading branch information
S7evinK authored Jun 28, 2023
1 parent a5ea928 commit 4722f12
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions clientapi/routing/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ func SetAvatarURL(
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
return *resErr
}
if r.AvatarURL == "" {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: spec.BadJSON("'avatar_url' must be supplied."),
}
}

localpart, domain, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {
Expand Down Expand Up @@ -199,12 +193,6 @@ func SetDisplayName(
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
return *resErr
}
if r.DisplayName == "" {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: spec.BadJSON("'displayname' must be supplied."),
}
}

localpart, domain, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {
Expand Down

0 comments on commit 4722f12

Please sign in to comment.