Skip to content

Commit

Permalink
fix: Filter featured collection
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Dec 27, 2023
1 parent a0c4766 commit 6794ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/server/activitypub/featured.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export default async (ctx: Router.RouterContext) => {
order: { id: 'DESC' }
});

const pinnedNotes = await Promise.all(pinings.map(pining =>
Notes.findOne(pining.noteId).then(ensure)));
const pinnedNotes = (await Promise.all(pinings.map(pining =>
Notes.findOneOrFail(pining.noteId))))
.filter(note => !note.localOnly && ['public', 'home'].includes(note.visibility));

const renderedNotes = await Promise.all(pinnedNotes.map(note => renderNote(note)));

Expand Down
4 changes: 2 additions & 2 deletions src/services/i/pin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function addPinned(user: User, noteId: Note['id']) {
} as UserNotePining);

// Deliver to remote followers
if (Users.isLocalUser(user)) {
if (Users.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
deliverPinnedChange(user.id, note.id, true);
}
}
Expand All @@ -72,7 +72,7 @@ export async function removePinned(user: User, noteId: Note['id']) {
});

// Deliver to remote followers
if (Users.isLocalUser(user)) {
if (Users.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
deliverPinnedChange(user.id, noteId, false);
}
}
Expand Down

0 comments on commit 6794ddf

Please sign in to comment.