From 02c3ee12dcdc7187e83436c2d435cede6ce2eccb Mon Sep 17 00:00:00 2001 From: cuteBoiButt Date: Thu, 5 Sep 2024 17:29:03 +0000 Subject: [PATCH 1/3] Use proper logging facilities in WebfingerService --- packages/backend/src/core/WebfingerService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/WebfingerService.ts b/packages/backend/src/core/WebfingerService.ts index 1517dd0074..86079a115b 100644 --- a/packages/backend/src/core/WebfingerService.ts +++ b/packages/backend/src/core/WebfingerService.ts @@ -8,6 +8,8 @@ import { Injectable } from '@nestjs/common'; import { XMLParser } from 'fast-xml-parser'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { bindThis } from '@/decorators.js'; +import Logger from '@/logger.js'; +import { RemoteLoggerService } from './RemoteLoggerService.js'; export type ILink = { href: string; @@ -28,9 +30,13 @@ const defaultProtocol = process.env.MISSKEY_WEBFINGER_USE_HTTP?.toLowerCase() == @Injectable() export class WebfingerService { + private logger: Logger; + constructor( private httpRequestService: HttpRequestService, + private remoteLoggerService: RemoteLoggerService, ) { + this.logger = this.remoteLoggerService.logger.createSubLogger('webfinger'); } @bindThis @@ -103,7 +109,7 @@ export class WebfingerService { const template = (hostMeta['XRD']['Link'] as Array).filter(p => p['@_rel'] === 'lrdd')[0]['@_template']; return template.indexOf('{uri}') < 0 ? null : template; } catch (err) { - console.error(`error while request host-meta for ${url}: ${err}`); + this.logger.error(`error while request host-meta for ${url}: ${err}`); return null; } } From 6b88c4f143716544b49817c0d93e2b972ede9edf Mon Sep 17 00:00:00 2001 From: cuteBoiButt Date: Fri, 6 Sep 2024 11:45:00 +0000 Subject: [PATCH 2/3] We don't need the whole Logger class here --- packages/backend/src/core/WebfingerService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/WebfingerService.ts b/packages/backend/src/core/WebfingerService.ts index 86079a115b..f57e7a2c1f 100644 --- a/packages/backend/src/core/WebfingerService.ts +++ b/packages/backend/src/core/WebfingerService.ts @@ -8,7 +8,7 @@ import { Injectable } from '@nestjs/common'; import { XMLParser } from 'fast-xml-parser'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { bindThis } from '@/decorators.js'; -import Logger from '@/logger.js'; +import type Logger from '@/logger.js'; import { RemoteLoggerService } from './RemoteLoggerService.js'; export type ILink = { From cc51f7038e35003ccb0807dc9a6218ca0699200f Mon Sep 17 00:00:00 2001 From: Esurio Date: Thu, 19 Sep 2024 12:37:56 +0000 Subject: [PATCH 3/3] fix: use i18n in settings --- locales/en-US.yml | 3 +++ locales/index.d.ts | 12 ++++++++++++ locales/ja-JP.yml | 3 +++ packages/frontend/src/pages/settings/general.vue | 6 +++--- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 58712657e8..6d24bb5b41 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -776,6 +776,7 @@ noCrawleDescription: "Ask search engines to not index your profile page, notes, lockedAccountInfo: "Unless you set your note visiblity to \"Followers only\", your notes will be visible to anyone, even if you require followers to be manually approved." alwaysMarkSensitive: "Mark as sensitive by default" loadRawImages: "Load original images instead of showing thumbnails" +showTickerOnReplies: "Show instance ticker on replies" searchEngine: "Search Engine For Search MFM" searchEngineOther: "Other" searchEngineCustomURIDescription: "The custom URI must be input in the format like \"https://www.google.com/search?q=\\{query}\" or \"https://www.google.com/search?q=%s\"." @@ -1089,6 +1090,8 @@ collapseRenotes: "Collapse boosts you've already seen" collapseRenotesDescription: "Collapse boosts that you have boosted or reacted to" collapseNotesRepliedTo: "Collapse notes replied to" collapseFiles: "Collapse files" +uncollapseCW: "Uncollapse CWs on notes" +expandLongNote: "Always expand long notes" autoloadConversation: "Load conversation on replies" internalServerError: "Internal Server Error" internalServerErrorDescription: "The server has run into an unexpected error." diff --git a/locales/index.d.ts b/locales/index.d.ts index 55a95f8fd9..177a3c8160 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3120,6 +3120,10 @@ export interface Locale extends ILocale { * 添付画像のサムネイルをオリジナル画質にする */ "loadRawImages": string; + /** + * 返信にサーバー情報を表示する + */ + "showTickerOnReplies": string; /** * 検索MFMの検索エンジン */ @@ -4373,6 +4377,14 @@ export interface Locale extends ILocale { * ファイルを折りたたむ */ "collapseFiles": string; + /** + * CWを展開する + */ + "uncollapseCW": string; + /** + * 長い投稿を常に展開する + */ + "expandLongNote": string; /** * 会話スレッドを自動で読み込む */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index da208147a1..b4d47a449c 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -776,6 +776,7 @@ noCrawleDescription: "外部の検索エンジンにあなたのユーザーペ lockedAccountInfo: "フォローを承認制にしても、ノートの公開範囲を「フォロワー」にしない限り、誰でもあなたのノートを見ることができます。" alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定にする" loadRawImages: "添付画像のサムネイルをオリジナル画質にする" +showTickerOnReplies: "返信にサーバー情報を表示する" searchEngine: "検索MFMの検索エンジン" searchEngineOther: "カスタム" searchEngineCustomURIDescription: "カスタム検索エンジンのURIは、\"https://www.google.com/search?q=\\{query}\" や \"https://www.google.com/search?q=%s\" のような形式で入力する必要があります。" @@ -1089,6 +1090,8 @@ collapseRenotes: "ブーストのスマート省略" collapseRenotesDescription: "リアクションやブーストをしたことがあるノートをたたんで表示します。" collapseNotesRepliedTo: "返信元のノートを折りたたむ" collapseFiles: "ファイルを折りたたむ" +uncollapseCW: "CWを展開する" +expandLongNote: "長い投稿を常に展開する" autoloadConversation: "会話スレッドを自動で読み込む" internalServerError: "サーバー内部エラー" internalServerErrorDescription: "サーバー内部で予期しないエラーが発生しました。" diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 75afe67be7..637c1b24b9 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -56,8 +56,8 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.collapseNotesRepliedTo }} {{ i18n.ts.collapseFiles }} - Uncollapse CWs on notes - Always expand long notes + {{ i18n.ts.uncollapseCW }} + {{ i18n.ts.expandLongNote }} {{ i18n.ts.showNoteActionsOnlyHover }} {{ i18n.ts.showClipButtonInNoteFooter }} {{ i18n.ts.autoloadConversation }} @@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.showReactionsCount }} {{ i18n.ts.showGapBetweenNotesInTimeline }} {{ i18n.ts.loadRawImages }} - Show instance ticker on replies + {{ i18n.ts.showTickerOnReplies }}