MM-35127 CRT: Marking thread as unread doesn't set the timestamp correctly (#17507)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Eli Yukelzon
2021-04-27 15:48:43 +03:00
коммит произвёл GitHub
родитель f73c77611f
Коммит 89281c00b1
2 изменённых файлов: 47 добавлений и 10 удалений

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

@@ -1387,18 +1387,14 @@ func (a *App) countThreadMentions(user *model.User, post *model.Post, teamID str
if nErr != nil {
return 0, model.NewAppError("countMentionsFromPost", "app.channel.count_posts_since.app_error", nil, nErr.Error(), http.StatusInternalServerError)
}
mentions := getExplicitMentions(post, keywords, groups)
if post.UpdateAt >= timestamp {
if _, ok := mentions.Mentions[user.Id]; ok {
count += 1
}
}
posts = append(posts, post)
for _, p := range posts {
mentions = getExplicitMentions(p, keywords, groups)
if _, ok := mentions.Mentions[user.Id]; ok {
count += 1
if p.CreateAt >= timestamp {
mentions := getExplicitMentions(p, keywords, groups)
if _, ok := mentions.Mentions[user.Id]; ok {
count += 1
}
}
}