From 6c3a9f46c5eefacd590538246d55cd6a66d6c650 Mon Sep 17 00:00:00 2001 From: miko Date: Mon, 12 Aug 2024 19:01:34 +0300 Subject: [PATCH] Add mod status in comment.list response --- server/services/v1/comments/list.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/services/v1/comments/list.go b/server/services/v1/comments/list.go index c50c1e0..d8d2ced 100644 --- a/server/services/v1/comments/list.go +++ b/server/services/v1/comments/list.go @@ -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) + if err != nil { + return err + } + items = append(items, item) continue } @@ -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.ChannelID.String, comment.LbryClaimID) + if err != nil { + return err + } + items = append(items, item) } return items, blockedCommentCnt, nil