From 8b8ee72a8195b920a72c3b947e66537b3042448f Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 30 Aug 2024 13:23:55 +0100 Subject: [PATCH] align NoteCreateService create & import --- packages/backend/src/core/NoteCreateService.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index fc3f91d792..1ccc6fe50b 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -281,7 +281,7 @@ export class NoteCreateService implements OnApplicationShutdown { data.visibility = 'home'; } - if (this.isRenote(data)) { + if (data.renote) { switch (data.renote.visibility) { case 'public': // public noteは無条件にrenote可能 @@ -367,6 +367,9 @@ export class NoteCreateService implements OnApplicationShutdown { mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens); } + // if the host is media-silenced, custom emojis are not allowed + if (this.utilityService.isMediaSilencedHost(meta.mediaSilencedHosts, user.host)) emojis = []; + tags = tags.filter(tag => Array.from(tag).length <= 128).splice(0, 32); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) { @@ -1018,11 +1021,13 @@ export class NoteCreateService implements OnApplicationShutdown { followeeId: user.id, notify: 'normal', }).then(followings => { - for (const following of followings) { - // TODO: ワードミュート考慮 - this.notificationService.createNotification(following.followerId, 'note', { - noteId: note.id, - }, user.id); + if (note.visibility !== 'specified') { + for (const following of followings) { + // TODO: ワードミュート考慮 + this.notificationService.createNotification(following.followerId, 'note', { + noteId: note.id, + }, user.id); + } } }); }