diff --git a/model/client4.go b/model/client4.go index ef28ba7387..fda171b781 100644 --- a/model/client4.go +++ b/model/client4.go @@ -6305,6 +6305,8 @@ func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status, } // UpdateUserCustomStatus sets a user's custom status based on the provided user id string. +// The returned CustomStatus object is the same as the one passed, and it should be just +// ignored. It's only kept to maintain compatibility. func (c *Client4) UpdateUserCustomStatus(userId string, userCustomStatus *CustomStatus) (*CustomStatus, *Response, error) { buf, err := json.Marshal(userCustomStatus) if err != nil { @@ -6315,11 +6317,10 @@ func (c *Client4) UpdateUserCustomStatus(userId string, userCustomStatus *Custom return nil, BuildResponse(r), err } defer closeBody(r) - var s CustomStatus - if jsonErr := json.NewDecoder(r.Body).Decode(&s); jsonErr != nil { - return nil, nil, NewAppError("UpdateUserCustomStatus", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError) - } - return &s, BuildResponse(r), nil + // This is returning the same status which was passed. + // The API was incorrectly designed to return a status returned from the server, + // but the server doesn't return anything except an OK. + return userCustomStatus, BuildResponse(r), nil } // RemoveUserCustomStatus remove a user's custom status based on the provided user id string.