diff --git a/packages/backend/src/services/push-notification.ts b/packages/backend/src/services/push-notification.ts index 56a8c83bf..5f1e30982 100644 --- a/packages/backend/src/services/push-notification.ts +++ b/packages/backend/src/services/push-notification.ts @@ -15,20 +15,21 @@ type pushNotificationsTypes = { 'readAllMessagingMessagesOfARoom': { userId: string } | { groupId: string }; }; -// プッシュメッセージサーバーには文字数制限があるため、内容を削減します +// Reduce the content of the push message because of the character limit function truncateNotification(notification: Packed<'Notification'>): any { if (notification.note) { return { ...notification, note: { ...notification.note, - // textをgetNoteSummaryしたものに置き換える + // replace text with getNoteSummary text: getNoteSummary(notification.type === 'renote' ? notification.note.renote as Packed<'Note'> : notification.note), cw: undefined, reply: undefined, renote: undefined, - user: undefined as any, // 通知を受け取ったユーザーである場合が多いのでこれも捨てる + // unnecessary, since usually the user who is receiving the notification knows who they are + user: undefined as any, }, }; } @@ -41,7 +42,7 @@ export async function pushNotification(u if (!meta.enableServiceWorker || meta.swPublicKey == null || meta.swPrivateKey == null) return; - // アプリケーションの連絡先と、サーバーサイドの鍵ペアの情報を登録 + // Register key pair information push.setVapidDetails(config.url, meta.swPublicKey, meta.swPrivateKey); @@ -65,10 +66,6 @@ export async function pushNotification(u }), { proxy: config.proxy, }).catch((err: any) => { - //swLogger.info(err.statusCode); - //swLogger.info(err.headers); - //swLogger.info(err.body); - if (err.statusCode === 410) { SwSubscriptions.delete({ userId,