Skip to content

Commit

Permalink
Add mod status in comment.list response
Browse files Browse the repository at this point in the history
  • Loading branch information
miko committed Aug 12, 2024
1 parent 8aa1adc commit a73ed3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/services/v1/comments/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ comments:
repliesCachedCount := repliesCountCache.Get(comment.CommentID)
if repliesCachedCount != nil && !repliesCachedCount.Expired() {
alreadyInSet[comment.CommentID] = true
items = append(items, populateItem(comment, channel, int(repliesCachedCount.Value().(int64))))
item := populateItem(comment, channel, int(repliesCachedCount.Value().(int64)))
err = applyModStatus(&item, comment.ChannelID.String, comment.LbryClaimID)

Check failure on line 313 in server/services/v1/comments/list.go

View workflow job for this annotation

GitHub Actions / build

undefined: err
if err != nil {

Check failure on line 314 in server/services/v1/comments/list.go

View workflow job for this annotation

GitHub Actions / build

undefined: err
return err

Check failure on line 315 in server/services/v1/comments/list.go

View workflow job for this annotation

GitHub Actions / build

undefined: err
}
items = append(items, item)
continue
}

Expand All @@ -325,7 +330,12 @@ comments:
return items, blockedCommentCnt, err
}
replies := val.(int64)
items = append(items, populateItem(comment, channel, int(replies)))
item := populateItem(comment, channel, int(replies))
err = applyModStatus(&item, comment.LbryClaimID, comment.ChannelID.String)
if err != nil {
return err

Check failure on line 336 in server/services/v1/comments/list.go

View workflow job for this annotation

GitHub Actions / build

not enough return values
}
items = append(items, item)
}

return items, blockedCommentCnt, nil
Expand Down

0 comments on commit a73ed3a

Please sign in to comment.