From 57d2368ba566b29854cb83fb3d128c23a909a0a0 Mon Sep 17 00:00:00 2001 From: Tatsuya Koishi Date: Sun, 28 Jan 2024 10:35:24 +0900 Subject: [PATCH] =?UTF-8?q?tagging.defaultTag=E3=81=8Cundefined=E3=81=AE?= =?UTF-8?q?=E3=82=B1=E3=83=BC=E3=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 8 ++++---- .../src/server/api/stream/channels/local-timeline.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 42d6aa4683..5460735799 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -322,8 +322,8 @@ export class NoteCreateService implements OnApplicationShutdown { // デフォルトハッシュタグ処理 if (['public', 'home'].includes(data.visibility)) { - if (this.config.tagging.defaultTag != null) { - const tag = `#${this.config.tagging.defaultTag}`; + if (this.config.tagging?.defaultTag != null) { + const tag = `#${this.config.tagging?.defaultTag}`; if (String(data.text).match(tag)) { data.text = `${data.text}\n\n${tag}`; } @@ -924,9 +924,9 @@ export class NoteCreateService implements OnApplicationShutdown { } // デフォルトハッシュタグ - if (this.config.tagging.defaultTag != null) { + if (this.config.tagging?.defaultTag != null) { const noteTags = note.tags ? note.tags.map((t: string) => t.toLowerCase()) : []; - if (note.visibility === 'public' && noteTags.includes(normalizeForSearch(this.config.tagging.defaultTag))) { + if (note.visibility === 'public' && noteTags.includes(normalizeForSearch(this.config.tagging?.defaultTag))) { this.fanoutTimelineService.push('localTimelineWithReplies', note.id, 300, r); this.fanoutTimelineService.push('localTimeline', note.id, 1000, r); if (note.fileIds.length > 0) { diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index e166af413d..f8d97a6aab 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -45,7 +45,7 @@ class LocalTimelineChannel extends Channel { this.withReplies = params.withReplies ?? false; this.withFiles = params.withFiles ?? false; const config = loadConfig(); - this.defaultTag = config.tagging.defaultTag; + this.defaultTag = config.tagging?.defaultTag; // Subscribe events this.subscriber.on('notesStream', this.onNote);