mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
fix away/offline/online commands repeating user message (#7060)
This commit is contained in:
@@ -33,11 +33,7 @@ func (me *AwayProvider) GetCommand(T goi18n.TranslateFunc) *model.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (me *AwayProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
func (me *AwayProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
||||||
rmsg := args.T("api.command_away.success")
|
|
||||||
if len(message) > 0 {
|
|
||||||
rmsg = message + " " + rmsg
|
|
||||||
}
|
|
||||||
SetStatusAwayIfNeeded(args.UserId, true)
|
SetStatusAwayIfNeeded(args.UserId, true)
|
||||||
|
|
||||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: rmsg}
|
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_away.success")}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ func (me *OfflineProvider) GetCommand(T goi18n.TranslateFunc) *model.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (me *OfflineProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
func (me *OfflineProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
||||||
rmsg := args.T("api.command_offline.success")
|
|
||||||
if len(message) > 0 {
|
|
||||||
rmsg = message + " " + rmsg
|
|
||||||
}
|
|
||||||
SetStatusOffline(args.UserId, true)
|
SetStatusOffline(args.UserId, true)
|
||||||
|
|
||||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: rmsg}
|
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_offline.success")}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ func (me *OnlineProvider) GetCommand(T goi18n.TranslateFunc) *model.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (me *OnlineProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
func (me *OnlineProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
|
||||||
rmsg := args.T("api.command_online.success")
|
|
||||||
if len(message) > 0 {
|
|
||||||
rmsg = message + " " + rmsg
|
|
||||||
}
|
|
||||||
SetStatusOnline(args.UserId, args.Session.Id, true)
|
SetStatusOnline(args.UserId, args.Session.Id, true)
|
||||||
|
|
||||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: rmsg}
|
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command_online.success")}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user