[MM-9938] Add support for multiple responses from a slash command (#9836)

* slash command response now supports multiple posts

* change wording of Posts to ExtraResponses
Этот коммит содержится в:
Michael Kochell
2018-11-19 11:00:50 -05:00
коммит произвёл Christopher Speller
родитель 246ff89391
Коммит a50e8ac5b9
3 изменённых файлов: 92 добавлений и 8 удалений

Просмотреть файл

@@ -277,6 +277,18 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
}
func (a *App) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) {
a.HandleCommandResponsePost(command, args, response, builtIn)
if response.ExtraResponses != nil {
for _, resp := range response.ExtraResponses {
a.HandleCommandResponsePost(command, args, resp, builtIn)
}
}
return response, nil
}
func (a *App) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) {
post := &model.Post{}
post.ChannelId = args.ChannelId
post.RootId = args.RootId