From 785f1897a42984ece9c6f65829d195d67e331d95 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Aug 2022 11:33:43 +0200 Subject: Add notification plugin hook --- server/lib/notifier/shared/follow/auto-follow-for-instance.ts | 4 ++-- server/lib/notifier/shared/follow/follow-for-instance.ts | 4 ++-- server/lib/notifier/shared/follow/follow-for-user.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/lib/notifier/shared/follow') diff --git a/server/lib/notifier/shared/follow/auto-follow-for-instance.ts b/server/lib/notifier/shared/follow/auto-follow-for-instance.ts index 01d2b3563..ab9747ba8 100644 --- a/server/lib/notifier/shared/follow/auto-follow-for-instance.ts +++ b/server/lib/notifier/shared/follow/auto-follow-for-instance.ts @@ -24,8 +24,8 @@ export class AutoFollowForInstance extends AbstractNotification ({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.AUTO_INSTANCE_FOLLOWING, userId: user.id, actorFollowId: this.actorFollow.id diff --git a/server/lib/notifier/shared/follow/follow-for-instance.ts b/server/lib/notifier/shared/follow/follow-for-instance.ts index a4a2fbf53..777a12ef4 100644 --- a/server/lib/notifier/shared/follow/follow-for-instance.ts +++ b/server/lib/notifier/shared/follow/follow-for-instance.ts @@ -32,8 +32,8 @@ export class FollowForInstance extends AbstractNotification { return this.admins } - async createNotification (user: MUserWithNotificationSetting) { - const notification = await UserNotificationModel.create({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.NEW_INSTANCE_FOLLOWER, userId: user.id, actorFollowId: this.actorFollow.id diff --git a/server/lib/notifier/shared/follow/follow-for-user.ts b/server/lib/notifier/shared/follow/follow-for-user.ts index e579d4487..697c82cdd 100644 --- a/server/lib/notifier/shared/follow/follow-for-user.ts +++ b/server/lib/notifier/shared/follow/follow-for-user.ts @@ -45,8 +45,8 @@ export class FollowForUser extends AbstractNotification { return [ this.user ] } - async createNotification (user: MUserWithNotificationSetting) { - const notification = await UserNotificationModel.create({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.NEW_FOLLOW, userId: user.id, actorFollowId: this.actorFollow.id -- cgit v1.2.3