[MM-14846] Update EditAt for FileIds and Attachment in Post + Ignore FileIds Updates (#10540)
* Set EditAt for FileIds and Attachments; Disallow update/patch of FileIds in API Handler * Add custom comparison methods for StringArray and Post Attachments * gofmt * Split up comparison function to child structs * Naming consistency * gofmt
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
41fe33bbb1
Коммит
7c9837d9b1
@@ -403,6 +403,23 @@ func (o *Post) Attachments() []*SlackAttachment {
|
||||
return ret
|
||||
}
|
||||
|
||||
func (o *Post) AttachmentsEqual(input *Post) bool {
|
||||
attachments := o.Attachments()
|
||||
inputAttachments := input.Attachments()
|
||||
|
||||
if len(attachments) != len(inputAttachments) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := range attachments {
|
||||
if !attachments[i].Equals(inputAttachments[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var markdownDestinationEscaper = strings.NewReplacer(
|
||||
`\`, `\\`,
|
||||
`<`, `\<`,
|
||||
|
||||
Ссылка в новой задаче
Block a user