From d28e7ec870e42516e9fedb4c3768fdc56bd2c596 Mon Sep 17 00:00:00 2001 From: OgmaJ Date: Mon, 23 Nov 2020 10:36:43 +0100 Subject: [PATCH] [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 --- app/slashcommands/command_dnd.go | 10 ---------- i18n/en.json | 8 -------- 2 files changed, 18 deletions(-) diff --git a/app/slashcommands/command_dnd.go b/app/slashcommands/command_dnd.go index 13a9cd880c..afc4e8afa5 100644 --- a/app/slashcommands/command_dnd.go +++ b/app/slashcommands/command_dnd.go @@ -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")} diff --git a/i18n/en.json b/i18n/en.json index 974715b8a5..b7aacbe285 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -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"