summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteReadService.ts
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2022-12-18 19:50:02 +0900
committerGitHub <noreply@github.com>2022-12-18 19:50:02 +0900
commit867e31c9ffefb57d01add5ad8568151fce39614c (patch)
tree133bec354505986b0db3bf95353b24e2d8277792 /packages/backend/src/core/NoteReadService.ts
parentchore(client): :art: about button (#9339) (diff)
downloadsharkey-867e31c9ffefb57d01add5ad8568151fce39614c.tar.gz
sharkey-867e31c9ffefb57d01add5ad8568151fce39614c.tar.bz2
sharkey-867e31c9ffefb57d01add5ad8568151fce39614c.zip
enhance: Push notification of Antenna note (#9338)
* wip * wip * wip * fix * fix * :art:
Diffstat (limited to 'packages/backend/src/core/NoteReadService.ts')
-rw-r--r--packages/backend/src/core/NoteReadService.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/backend/src/core/NoteReadService.ts b/packages/backend/src/core/NoteReadService.ts
index f70495ff30..82825b8b15 100644
--- a/packages/backend/src/core/NoteReadService.ts
+++ b/packages/backend/src/core/NoteReadService.ts
@@ -12,6 +12,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { NotificationService } from './NotificationService.js';
import { AntennaService } from './AntennaService.js';
import { bindThis } from '@/decorators.js';
+import { PushNotificationService } from './PushNotificationService.js';
@Injectable()
export class NoteReadService {
@@ -42,6 +43,7 @@ export class NoteReadService {
private globalEventServie: GlobalEventService,
private notificationService: NotificationService,
private antennaService: AntennaService,
+ private pushNotificationService: PushNotificationService,
) {
}
@@ -205,12 +207,14 @@ export class NoteReadService {
if (count === 0) {
this.globalEventServie.publishMainStream(userId, 'readAntenna', antenna);
+ this.pushNotificationService.pushNotification(userId, 'readAntenna', { antennaId: antenna.id });
}
}
this.userEntityService.getHasUnreadAntenna(userId).then(unread => {
if (!unread) {
this.globalEventServie.publishMainStream(userId, 'readAllAntennas');
+ this.pushNotificationService.pushNotification(userId, 'readAllAntennas', undefined);
}
});
}