Change Post.IsFollowing to a pointer and set to nil for responses to updates to Posts (#17774)

This commit is contained in:
Joram Wilander
2021-06-14 08:25:44 -04:00
committed by GitHub
parent 857c5e562f
commit 326eb2242a
5 changed files with 15 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ type SqlPostStore struct {
type postWithExtra struct {
ThreadReplyCount int64
IsFollowing bool
IsFollowing *bool
ThreadParticipants model.StringArray
model.Post
}
@@ -739,7 +739,9 @@ func (s *SqlPostStore) prepareThreadedResponse(posts []*postWithExtra, extended,
}
processPost := func(p *postWithExtra) error {
p.Post.ReplyCount = p.ThreadReplyCount
p.Post.IsFollowing = p.IsFollowing
if p.IsFollowing != nil {
p.Post.IsFollowing = model.NewBool(*p.IsFollowing)
}
for _, th := range p.ThreadParticipants {
var participant *model.User
for _, u := range users {