summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteCreateService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts24
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 1c8491bf57..648ff76483 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -570,12 +570,14 @@ export class NoteCreateService implements OnApplicationShutdown {
if (data.reply) {
// 通知
if (data.reply.userHost === null) {
- const threadMuted = await this.noteThreadMutingsRepository.findOneBy({
- userId: data.reply.userId,
- threadId: data.reply.threadId ?? data.reply.id,
+ const isThreadMuted = await this.noteThreadMutingsRepository.exist({
+ where: {
+ userId: data.reply.userId,
+ threadId: data.reply.threadId ?? data.reply.id,
+ },
});
- if (!threadMuted) {
+ if (!isThreadMuted) {
nm.push(data.reply.userId, 'reply');
this.globalEventService.publishMainStream(data.reply.userId, 'reply', noteObj);
@@ -672,7 +674,7 @@ export class NoteCreateService implements OnApplicationShutdown {
// Register to search database
this.index(note);
}
-
+
@bindThis
private isSensitive(note: Option, sensitiveWord: string[]): boolean {
if (sensitiveWord.length > 0) {
@@ -712,12 +714,14 @@ export class NoteCreateService implements OnApplicationShutdown {
@bindThis
private async createMentionedEvents(mentionedUsers: MinimumUser[], note: Note, nm: NotificationManager) {
for (const u of mentionedUsers.filter(u => this.userEntityService.isLocalUser(u))) {
- const threadMuted = await this.noteThreadMutingsRepository.findOneBy({
- userId: u.id,
- threadId: note.threadId ?? note.id,
+ const isThreadMuted = await this.noteThreadMutingsRepository.exist({
+ where: {
+ userId: u.id,
+ threadId: note.threadId ?? note.id,
+ },
});
- if (threadMuted) {
+ if (isThreadMuted) {
continue;
}
@@ -758,7 +762,7 @@ export class NoteCreateService implements OnApplicationShutdown {
@bindThis
private index(note: Note) {
if (note.text == null && note.cw == null) return;
-
+
this.searchService.indexNote(note);
}