MM-37372 Do not autofollow threads started by webhooks/bots for user who created them (#18276)
* Do not autofollow threads started by webhooks/bots for user who created them * Add test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
60074de844
Коммит
b6ae217883
@@ -201,9 +201,11 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
||||
if *a.Config().ServiceSettings.ThreadAutoFollow && post.RootId != "" {
|
||||
var rootMentions *ExplicitMentions
|
||||
if parentPostList != nil {
|
||||
threadParticipants[parentPostList.Posts[parentPostList.Order[0]].UserId] = true
|
||||
rootPost := parentPostList.Posts[parentPostList.Order[0]]
|
||||
if rootPost.GetProp("from_webhook") != "true" {
|
||||
threadParticipants[rootPost.UserId] = true
|
||||
}
|
||||
if channel.Type != model.ChannelTypeDirect {
|
||||
rootPost := parentPostList.Posts[parentPostList.Order[0]]
|
||||
rootMentions = getExplicitMentions(rootPost, keywords, groups)
|
||||
for id := range rootMentions.Mentions {
|
||||
threadParticipants[id] = true
|
||||
|
||||
Ссылка в новой задаче
Block a user