[MM-11860]: Expose slack attachment parsing functions in the model package (#9351)

Refactored parseSlackAttachment functions from https://github.com/mattermost/mattermost-server/blob/master/app/post.go#L312
into model/slack_attachments.go so that plugins have access to them.
Этот коммит содержится в:
Charles Birk
2018-09-17 10:15:28 -04:00
коммит произвёл Joram Wilander
родитель 7226ea7dfb
Коммит a755bcdde6
5 изменённых файлов: 30 добавлений и 30 удалений

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

@@ -38,7 +38,7 @@ func GetCommandProvider(name string) CommandProvider {
}
func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse) (*model.Post, *model.AppError) {
post.Message = parseSlackLinksToMarkdown(response.Text)
post.Message = model.ParseSlackLinksToMarkdown(response.Text)
post.CreateAt = model.GetMillis()
if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) {
@@ -47,7 +47,7 @@ func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model
}
if response.Attachments != nil {
parseSlackAttachment(post, response.Attachments)
model.ParseSlackAttachment(post, response.Attachments)
}
if response.ResponseType == model.COMMAND_RESPONSE_TYPE_IN_CHANNEL {