Automatic Merge
Этот коммит содержится в:
Mattermost Build
2026-06-05 14:29:47 +02:00
коммит произвёл GitHub
родитель f6d3a7827e
Коммит 03787f9386
2 изменённых файлов: 73 добавлений и 0 удалений

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

@@ -507,6 +507,10 @@ func (scs *Service) upsertSyncPost(post *model.Post, targetChannel *model.Channe
)
}
} else if post.DeleteAt > 0 {
// make sure the post being deleted is owned by the remote
if rpost.GetRemoteID() != rc.RemoteId {
return nil, fmt.Errorf("post sync failed: %w", ErrRemoteIDMismatch)
}
// delete post
rpost, appErr = scs.app.DeletePost(rctx, post.Id, post.UserId)
if appErr == nil {
@@ -516,6 +520,10 @@ func (scs *Service) upsertSyncPost(post *model.Post, targetChannel *model.Channe
)
}
} else if post.EditAt > rpost.EditAt || post.Message != rpost.Message || post.UpdateAt > rpost.UpdateAt || post.Metadata != nil {
// make sure the post being edited is owned by the remote
if rpost.GetRemoteID() != rc.RemoteId {
return nil, fmt.Errorf("post sync failed: %w", ErrRemoteIDMismatch)
}
scs.transformMentionsOnReceive(rctx, post, targetChannel, rc, mentionTransforms)
var priority *model.PostPriority
var acknowledgements []*model.PostAcknowledgement