feat: support comments in latest activities

This commit is contained in:
DIYgod
2023-05-20 00:16:42 +01:00
parent c0f85930d5
commit 2c77b959eb
2 changed files with 126 additions and 75 deletions
+9 -3
View File
@@ -47,7 +47,7 @@ export async function getFeed({
case "latest": {
let result = await indexer.note.getMany({
sources: "xlog",
tags: ["post"],
// tags: ["post"],
limit,
cursor,
includeCharacter: true,
@@ -56,12 +56,18 @@ export async function getFeed({
const list = await Promise.all(
result.list.map(async (page: any) => {
const isComment = page.metadata?.content?.tags?.includes("comment")
const expand = await expandCrossbellNote({
note: page,
useStat: false,
useScore: true,
useScore: !isComment,
useHTML,
})
if (isComment && expand.toNote) {
expand.toNote = await expandCrossbellNote({
note: expand.toNote,
useHTML,
})
}
delete expand.metadata?.content.content
return expand
}),