[MM-36544][MM-37439] Don't re-follow on reply to unfollowed thread (#18020)
Summary If a user has unfollowed a thread, another user's reply in the thread should not cause the first user to re-follow the thread. The first user will be re-followed if they are mentioned in the thread. Simplify and make flexible the logic surrounding following and remove some duplicate code. Ticket Link https://mattermost.atlassian.net/browse/MM-36544 https://mattermost.atlassian.net/browse/MM-37439
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
973e008c53
Коммит
296076bf2d
@@ -611,7 +611,7 @@ func (s *SqlThreadStore) MaintainMembership(userId, postId string, opts store.Th
|
||||
// b. mention count changed
|
||||
// c. user viewed a thread
|
||||
if err == nil {
|
||||
followingNeedsUpdate := (opts.UpdateFollowing && !membership.Following || membership.Following != opts.Following)
|
||||
followingNeedsUpdate := (opts.UpdateFollowing && (membership.Following != opts.Following))
|
||||
if followingNeedsUpdate || opts.IncrementMentions || opts.UpdateViewedTimestamp {
|
||||
if followingNeedsUpdate {
|
||||
membership.Following = opts.Following
|
||||
|
||||
@@ -934,7 +934,7 @@ type ThreadMembershipOpts struct {
|
||||
// IncrementMentions indicates whether or not the mentions count for
|
||||
// the thread should be incremented.
|
||||
IncrementMentions bool
|
||||
// UpdateFollowing indicates whether or not a membership update should be forced.
|
||||
// UpdateFollowing indicates whether or not the following state should be changed.
|
||||
UpdateFollowing bool
|
||||
// UpdateViewedTimestamp indicates whether or not the LastViewed field of the
|
||||
// membership should be updated.
|
||||
|
||||
Ссылка в новой задаче
Block a user