Skip to content

Commit

Permalink
Merge pull request #150 from Sayamame-beans/149-additional-patch
Browse files Browse the repository at this point in the history
spec(backend/NoteCreateService): ローカルユーザーがまだ誰もフォローしていないリモートユーザーによる投稿の…
  • Loading branch information
Sayamame-beans authored Feb 21, 2024
2 parents 017663a + a76889d commit 7d922f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/backend/src/core/NoteCreateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ export class NoteCreateService implements OnApplicationShutdown {
mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens);
}

const willCauseNotification = mentionedUsers.filter(u => u.host === null).length > 0 || data.reply?.userHost === null || data.renote?.userHost === null;
const willCauseNotification = mentionedUsers.some(u => u.host === null)
|| (data.visibility === 'specified' && data.visibleUsers?.some(u => u.host === null))
|| data.reply?.userHost === null || (this.isQuote(data) && data.renote?.userHost === null) || false;

if (this.config.nirila.blockMentionsFromUnfamiliarRemoteUsers && user.host !== null && willCauseNotification) {
const userEntity = await this.usersRepository.findOneBy({ id: user.id });
Expand Down

0 comments on commit 7d922f4

Please sign in to comment.