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 88496d9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server/services/v1/comments/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,13 @@ 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 +331,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 337 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 88496d9

Please sign in to comment.