summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2023-04-11 14:11:39 +0900
committerGitHub <noreply@github.com>2023-04-11 14:11:39 +0900
commit3a90bcc03cc166632fb64aa76130b63a0ad37a64 (patch)
treee5e6e6e07eb30d1369142d86546b6ab419d31a1b /packages/backend/src/core
parentfix #10554 チャンネルの検索用ページとAPIの追加 (#10555) (diff)
downloadmisskey-3a90bcc03cc166632fb64aa76130b63a0ad37a64.tar.gz
misskey-3a90bcc03cc166632fb64aa76130b63a0ad37a64.tar.bz2
misskey-3a90bcc03cc166632fb64aa76130b63a0ad37a64.zip
sw: なんかもうめっちゃ変えた (#10570)
* sw: なんかいろいろ * remove debug code * never renotify * update changelog.md
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/NotificationService.ts1
-rw-r--r--packages/backend/src/core/PushNotificationService.ts5
2 files changed, 6 insertions, 0 deletions
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts
index c7dac061b2..6691c42836 100644
--- a/packages/backend/src/core/NotificationService.ts
+++ b/packages/backend/src/core/NotificationService.ts
@@ -66,6 +66,7 @@ export class NotificationService implements OnApplicationShutdown {
@bindThis
private postReadAllNotifications(userId: User['id']) {
this.globalEventService.publishMainStream(userId, 'readAllNotifications');
+ this.pushNotificationService.pushNotification(userId, 'readAllNotifications', undefined);
}
@bindThis
diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts
index 69020f7e84..fd24831fbc 100644
--- a/packages/backend/src/core/PushNotificationService.ts
+++ b/packages/backend/src/core/PushNotificationService.ts
@@ -15,6 +15,7 @@ type PushNotificationsTypes = {
antenna: { id: string, name: string };
note: Packed<'Note'>;
};
+ 'readAllNotifications': undefined;
};
// Reduce length because push message servers have character limits
@@ -68,6 +69,10 @@ export class PushNotificationService {
});
for (const subscription of subscriptions) {
+ if ([
+ 'readAllNotifications',
+ ].includes(type) && !subscription.sendReadMessage) continue;
+
const pushSubscription = {
endpoint: subscription.endpoint,
keys: {