diff --git a/api4/status.go b/api4/status.go index 9e02f21f0f..902c7a5ca3 100644 --- a/api4/status.go +++ b/api4/status.go @@ -15,7 +15,11 @@ func (api *API) InitStatus() { api.BaseRoutes.User.Handle("/status", api.ApiSessionRequired(updateUserStatus)).Methods("PUT") api.BaseRoutes.User.Handle("/status/custom", api.ApiSessionRequired(updateUserCustomStatus)).Methods("PUT") api.BaseRoutes.User.Handle("/status/custom", api.ApiSessionRequired(removeUserCustomStatus)).Methods("DELETE") + + // Both these handlers are for removing the recent custom status but the one with the POST method should be preferred + // as DELETE method doesn't support request body in the mobile app. api.BaseRoutes.User.Handle("/status/custom/recent", api.ApiSessionRequired(removeUserRecentCustomStatus)).Methods("DELETE") + api.BaseRoutes.User.Handle("/status/custom/recent/delete", api.ApiSessionRequired(removeUserRecentCustomStatus)).Methods("POST") } func getUserStatus(c *Context, w http.ResponseWriter, r *http.Request) { diff --git a/app/slashcommands/command_custom_status.go b/app/slashcommands/command_custom_status.go index 287794f921..b93884c40e 100644 --- a/app/slashcommands/command_custom_status.go +++ b/app/slashcommands/command_custom_status.go @@ -45,6 +45,7 @@ func (*CustomStatusProvider) DoCommand(a *app.App, args *model.CommandArgs, mess return nil } + message = strings.TrimSpace(message) if message == CmdCustomStatusClear { if err := a.RemoveCustomStatus(args.UserId); err != nil { mlog.Error(err.Error())