[MM-30136] Issuing /dnd consecutively should not toggle the user status between dnd and online (#16258)
Summary /dnd will only do a do not disturb Ticket Link Fixes #16253 JIRA https://mattermost.atlassian.net/browse/MM-30136 Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -34,16 +34,6 @@ func (me *DndProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Com
|
||||
}
|
||||
|
||||
func (me *DndProvider) DoCommand(a *app.App, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
status, err := a.GetStatus(args.UserId)
|
||||
if err != nil {
|
||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_dnd.error")}
|
||||
} else {
|
||||
if status.Status == "dnd" {
|
||||
a.SetStatusOnline(args.UserId, true)
|
||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_dnd.disabled")}
|
||||
}
|
||||
}
|
||||
|
||||
a.SetStatusDoNotDisturb(args.UserId)
|
||||
|
||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_dnd.success")}
|
||||
|
||||
@@ -715,14 +715,6 @@
|
||||
"id": "api.command_dnd.desc",
|
||||
"translation": "Do not disturb disables desktop and mobile push notifications."
|
||||
},
|
||||
{
|
||||
"id": "api.command_dnd.disabled",
|
||||
"translation": "Do Not Disturb is disabled."
|
||||
},
|
||||
{
|
||||
"id": "api.command_dnd.error",
|
||||
"translation": "Error to retrieve the user status."
|
||||
},
|
||||
{
|
||||
"id": "api.command_dnd.name",
|
||||
"translation": "dnd"
|
||||
|
||||
Ссылка в новой задаче
Block a user