Skip to content

Commit

Permalink
Filter featured collection
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Dec 2, 2023
1 parent 4e5b776 commit cc3ab61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/core/NotePiningService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class NotePiningService {
} as MiUserNotePining);

// Deliver to remote followers
if (this.userEntityService.isLocalUser(user)) {
if (this.userEntityService.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
this.deliverPinnedChange(user.id, note.id, true);
}
}
Expand Down Expand Up @@ -105,7 +105,7 @@ export class NotePiningService {
});

// Deliver to remote followers
if (this.userEntityService.isLocalUser(user)) {
if (this.userEntityService.isLocalUser(user) && !note.localOnly && ['public', 'home'].includes(note.visibility)) {
this.deliverPinnedChange(user.id, noteId, false);
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/backend/src/server/ActivityPubServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ export class ActivityPubServerService {
order: { id: 'DESC' },
});

const pinnedNotes = await Promise.all(pinings.map(pining =>
this.notesRepository.findOneByOrFail({ id: pining.noteId })));
const pinnedNotes = (await Promise.all(pinings.map(pining =>
this.notesRepository.findOneByOrFail({ id: pining.noteId }))))
.filter(note => !note.localOnly && ['public', 'home'].includes(note.visibility));

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

Expand Down

0 comments on commit cc3ab61

Please sign in to comment.