summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/ReactionService.ts
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-07-30 19:47:45 +0900
committerGitHub <noreply@github.com>2024-07-30 19:47:45 +0900
commit5c42a0e43931f62490c44e389db893b6bfe9e349 (patch)
treee31e64d66fca965e87fc4c2fe3097a5e6b1b87e6 /packages/backend/src/core/ReactionService.ts
parent自分のフォロワー限定投稿に対するリプライがホームタ... (diff)
downloadmisskey-5c42a0e43931f62490c44e389db893b6bfe9e349.tar.gz
misskey-5c42a0e43931f62490c44e389db893b6bfe9e349.tar.bz2
misskey-5c42a0e43931f62490c44e389db893b6bfe9e349.zip
feat: media silence (#13842)
* feat: media silence * fix: lint * feat: deny creating custom emoji reaction and using custom emoji from media silenced hosts * chore: メディアサイレンスの説明にカスタム絵文字の話を追加 * Update locales/ja-JP.yml Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> * chore: update index.d.ts * docs(changelog): update changelog --------- Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core/ReactionService.ts')
-rw-r--r--packages/backend/src/core/ReactionService.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts
index 64c7b2ed03..371207c33a 100644
--- a/packages/backend/src/core/ReactionService.ts
+++ b/packages/backend/src/core/ReactionService.ts
@@ -105,6 +105,8 @@ export class ReactionService {
@bindThis
public async create(user: { id: MiUser['id']; host: MiUser['host']; isBot: MiUser['isBot'] }, note: MiNote, _reaction?: string | null) {
+ const meta = await this.metaService.fetch();
+
// Check blocking
if (note.userId !== user.id) {
const blocked = await this.userBlockingService.checkBlocked(note.userId, user.id);
@@ -148,6 +150,11 @@ export class ReactionService {
if ((note.reactionAcceptance === 'nonSensitiveOnly' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && emoji.isSensitive) {
reaction = FALLBACK;
}
+
+ // for media silenced host, custom emoji reactions are not allowed
+ if (reacterHost != null && this.utilityService.isMediaSilencedHost(meta.mediaSilencedHosts, reacterHost)) {
+ reaction = FALLBACK;
+ }
} else {
// リアクションとして使う権限がない
reaction = FALLBACK;
@@ -220,8 +227,6 @@ export class ReactionService {
}
}
- const meta = await this.metaService.fetch();
-
if (meta.enableChartsForRemoteUser || (user.host == null)) {
this.perUserReactionsChart.update(user, note);
}