diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-05-19 09:43:38 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-05-19 09:43:38 +0900 |
| commit | 3804c6e7ad8c08f87e99d7e68a7d5c0e8af68dfa (patch) | |
| tree | 78bbe9da939cf319d62306ec5d9a2677d74c7da1 /packages/backend/src/core/ReactionService.ts | |
| parent | enhance(frontend): リアクションの取り消し/変更時に確認ダイ... (diff) | |
| download | sharkey-3804c6e7ad8c08f87e99d7e68a7d5c0e8af68dfa.tar.gz sharkey-3804c6e7ad8c08f87e99d7e68a7d5c0e8af68dfa.tar.bz2 sharkey-3804c6e7ad8c08f87e99d7e68a7d5c0e8af68dfa.zip | |
feat: センシティブなカスタム絵文字のリアクションを受け入れない設定を追加
Diffstat (limited to 'packages/backend/src/core/ReactionService.ts')
| -rw-r--r-- | packages/backend/src/core/ReactionService.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index 27334b33e6..4b01b6af7e 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -106,7 +106,7 @@ export class ReactionService { let reaction = _reaction ?? FALLBACK; - if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote') && (user.host != null))) { + if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) { reaction = '❤️'; } else if (_reaction) { const custom = reaction.match(isCustomEmojiRegexp); @@ -124,6 +124,11 @@ export class ReactionService { if (emoji) { if (emoji.roleIdsThatCanBeUsedThisEmojiAsReaction.length === 0 || (await this.roleService.getUserRoles(user.id)).some(r => emoji.roleIdsThatCanBeUsedThisEmojiAsReaction.includes(r.id))) { reaction = reacterHost ? `:${name}@${reacterHost}:` : `:${name}:`; + + // センシティブ + if ((note.reactionAcceptance === 'nonSensitiveOnly') && emoji.isSensitive) { + reaction = FALLBACK; + } } else { // リアクションとして使う権限がない reaction = FALLBACK; |