MM-30970 Add Basic unreadMentions support for collapsed threads (#16407)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1bd7dc41bd
Коммит
c2036f614e
@@ -8318,11 +8318,11 @@ func (s *RetryLayerThreadStore) CollectThreadsWithNewerReplies(userId string, ch
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) CreateMembershipIfNeeded(userId string, postId string, following bool) error {
|
||||
func (s *RetryLayerThreadStore) CreateMembershipIfNeeded(userId string, postId string, following bool, incrementMentions bool, updateFollowing bool) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ThreadStore.CreateMembershipIfNeeded(userId, postId, following)
|
||||
err := s.ThreadStore.CreateMembershipIfNeeded(userId, postId, following, incrementMentions, updateFollowing)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -8438,6 +8438,26 @@ func (s *RetryLayerThreadStore) GetMembershipsForUser(userId string) ([]*model.T
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetPosts(threadId string, since int64) ([]*model.Post, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetPosts(threadId, since)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
if !isRepeatableError(err) {
|
||||
return result, err
|
||||
}
|
||||
tries++
|
||||
if tries >= 3 {
|
||||
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetThreadsForUser(userId string, opts model.GetUserThreadsOpts) (*model.Threads, error) {
|
||||
|
||||
tries := 0
|
||||
@@ -8598,11 +8618,11 @@ func (s *RetryLayerThreadStore) UpdateMembership(membership *model.ThreadMembers
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) UpdateUnreadsByChannel(userId string, changedThreads []string, timestamp int64) error {
|
||||
func (s *RetryLayerThreadStore) UpdateUnreadsByChannel(userId string, changedThreads []string, timestamp int64, updateViewedTimestamp bool) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ThreadStore.UpdateUnreadsByChannel(userId, changedThreads, timestamp)
|
||||
err := s.ThreadStore.UpdateUnreadsByChannel(userId, changedThreads, timestamp, updateViewedTimestamp)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user