MM-40664: fixes CRT notifications (#19328)

* MM-40664: fixes CRT notifications

Reply notification settings that take effect when CRT is off where
considered when CRT is on as well. Resulting, in some cases, in not
respecting the CRT setting for notifications.
This commit fixes that by guarding against IsCRTEnabledForUser when
checking for reply notification settings.

* Adds test cases

* Satisfies the vet

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Kyriakos Z
2022-01-31 17:47:18 +02:00
коммит произвёл GitHub
родитель e03384c4d1
Коммит e23a7a2311
2 изменённых файлов: 158 добавлений и 0 удалений

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

@@ -156,6 +156,9 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
if threadPost.Id == parentPostList.Order[0] && threadPost.IsFromOAuthBot() {
continue
}
if a.IsCRTEnabledForUser(profile.Id) {
continue
}
if profile.NotifyProps[model.CommentsNotifyProp] == model.CommentsNotifyAny || (profile.NotifyProps[model.CommentsNotifyProp] == model.CommentsNotifyRoot && threadPost.Id == parentPostList.Order[0]) {
mentionType := ThreadMention
if threadPost.Id == parentPostList.Order[0] {