MM-35128 CRT: Global Threads item should not be affected by 'mark as unread' in channel (#17505)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
89281c00b1
Коммит
3d6e69b002
@@ -2389,9 +2389,9 @@ func (a *App) MarkChannelAsUnreadFromPost(postID string, userID string) (*model.
|
||||
}
|
||||
|
||||
threadMembership, _ := a.Srv().Store.Thread().GetMembershipForUser(user.Id, threadId)
|
||||
// if this post was not followed before, create thread membership and update mention count
|
||||
if threadMembership == nil {
|
||||
threadMembership, _ = a.Srv().Store.Thread().MaintainMembership(user.Id, threadId, true, true, true, true, false)
|
||||
}
|
||||
threadData, _ := a.Srv().Store.Thread().Get(threadId)
|
||||
if threadData != nil && threadMembership != nil && threadMembership.Following {
|
||||
channel, nErr := a.Srv().Store.Channel().Get(post.ChannelId, true)
|
||||
@@ -2423,6 +2423,8 @@ func (a *App) MarkChannelAsUnreadFromPost(postID string, userID string) (*model.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
channelUnread, nErr := a.Srv().Store.Channel().UpdateLastViewedAtPost(post, userID, unreadMentions, unreadMentionsRoot, *a.Config().ServiceSettings.ThreadAutoFollow)
|
||||
if nErr != nil {
|
||||
return channelUnread, model.NewAppError("MarkChannelAsUnreadFromPost", "app.channel.update_last_viewed_at_post.app_error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||
|
||||
@@ -2289,7 +2289,7 @@ func (s SqlChannelStore) UpdateLastViewedAtPost(unreadPost *model.Post, userID s
|
||||
}
|
||||
|
||||
if updateThreads {
|
||||
s.Thread().UpdateUnreadsByChannel(userID, threadsToUpdate, unreadDate, true)
|
||||
s.Thread().UpdateUnreadsByChannel(userID, threadsToUpdate, unreadDate, false)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user