diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-03 11:33:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-03 11:33:43 +0200 |
commit | 785f1897a42984ece9c6f65829d195d67e331d95 (patch) | |
tree | 1cb3b33cfc797b8f1abbab90749c1e3187bbd311 /server/lib/notifier/shared/follow | |
parent | 0260dc8aca952f9412a8620e433b9e16e675696e (diff) | |
download | PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.tar.gz PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.tar.zst PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.zip |
Add notification plugin hook
Diffstat (limited to 'server/lib/notifier/shared/follow')
3 files changed, 6 insertions, 6 deletions
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 <MActorFollowFul | |||
24 | return this.admins | 24 | return this.admins |
25 | } | 25 | } |
26 | 26 | ||
27 | async createNotification (user: MUserWithNotificationSetting) { | 27 | createNotification (user: MUserWithNotificationSetting) { |
28 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 28 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
29 | type: UserNotificationType.AUTO_INSTANCE_FOLLOWING, | 29 | type: UserNotificationType.AUTO_INSTANCE_FOLLOWING, |
30 | userId: user.id, | 30 | userId: user.id, |
31 | actorFollowId: this.actorFollow.id | 31 | 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 <MActorFollowFull> { | |||
32 | return this.admins | 32 | return this.admins |
33 | } | 33 | } |
34 | 34 | ||
35 | async createNotification (user: MUserWithNotificationSetting) { | 35 | createNotification (user: MUserWithNotificationSetting) { |
36 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 36 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
37 | type: UserNotificationType.NEW_INSTANCE_FOLLOWER, | 37 | type: UserNotificationType.NEW_INSTANCE_FOLLOWER, |
38 | userId: user.id, | 38 | userId: user.id, |
39 | actorFollowId: this.actorFollow.id | 39 | 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 <MActorFollowFull> { | |||
45 | return [ this.user ] | 45 | return [ this.user ] |
46 | } | 46 | } |
47 | 47 | ||
48 | async createNotification (user: MUserWithNotificationSetting) { | 48 | createNotification (user: MUserWithNotificationSetting) { |
49 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 49 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
50 | type: UserNotificationType.NEW_FOLLOW, | 50 | type: UserNotificationType.NEW_FOLLOW, |
51 | userId: user.id, | 51 | userId: user.id, |
52 | actorFollowId: this.actorFollow.id | 52 | actorFollowId: this.actorFollow.id |