Skip to content

Commit

Permalink
Renote・Replyも対象に
Browse files Browse the repository at this point in the history
  • Loading branch information
EbiseLutica committed Feb 17, 2024
1 parent 33cb507 commit a27af00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/backend/src/core/NoteCreateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ export class NoteCreateService implements OnApplicationShutdown {
mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens);
}

const willCauseNotification = mentionedUsers.length > 0 || data.reply?.userHost === null || data.renote?.userHost === null;

// #region Shrimpia
if (user.host != null && mentionedUsers.length > 0) {
if (user.host != null && willCauseNotification) {
const userEntity = await this.usersRepository.findOneBy({ id: user.id });
if ((userEntity?.followersCount ?? 0) === 0) {
throw new Error('Temporarily, notes including mentions from remote users which no followers are not allowed');
throw new Error('Temporarily, notes including mentions, replies and renotes to local-user from remote users which is not followed by local-users are not allowed');
}
}
// #endregion
Expand Down

0 comments on commit a27af00

Please sign in to comment.