align NoteCreateService create & import

This commit is contained in:
dakkar 2024-08-30 13:23:55 +01:00
parent 311d26547a
commit 8b8ee72a81

View file

@ -281,7 +281,7 @@ export class NoteCreateService implements OnApplicationShutdown {
data.visibility = 'home'; data.visibility = 'home';
} }
if (this.isRenote(data)) { if (data.renote) {
switch (data.renote.visibility) { switch (data.renote.visibility) {
case 'public': case 'public':
// public noteは無条件にrenote可能 // public noteは無条件にrenote可能
@ -367,6 +367,9 @@ export class NoteCreateService implements OnApplicationShutdown {
mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens); 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); 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)) { 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, followeeId: user.id,
notify: 'normal', notify: 'normal',
}).then(followings => { }).then(followings => {
for (const following of followings) { if (note.visibility !== 'specified') {
// TODO: ワードミュート考慮 for (const following of followings) {
this.notificationService.createNotification(following.followerId, 'note', { // TODO: ワードミュート考慮
noteId: note.id, this.notificationService.createNotification(following.followerId, 'note', {
}, user.id); noteId: note.id,
}, user.id);
}
} }
}); });
} }