MM-35415: ignore notification setting for CRT reply posts (#17773)

Summary
The user will NOT get a mention badge simply because he participated in or started a thread.

Ticket Link
https://mattermost.atlassian.net/browse/MM-35415
Этот коммит содержится в:
Ashish Bhate
2021-06-17 08:40:24 +05:30
коммит произвёл GitHub
родитель b0bdd23d2c
Коммит f0bd973a5c
2 изменённых файлов: 77 добавлений и 1 удалений

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

@@ -191,7 +191,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
mac := make(chan *model.AppError, 1)
go func(userID string) {
defer close(mac)
_, incrementMentions := mentions.Mentions[userID]
mentionType, incrementMentions := mentions.Mentions[userID]
// if the user was not explicitly mentioned, check if they explicitly unfollowed the thread
if !incrementMentions {
membership, err := a.Srv().Store.Thread().GetMembershipForUser(userID, post.RootId)
@@ -206,6 +206,9 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
return
}
}
if mentionType == ThreadMention || mentionType == CommentMention {
incrementMentions = false
}
opts := store.ThreadMembershipOpts{
Following: true,