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/instance | |
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/instance')
3 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/notifier/shared/instance/new-peertube-version-for-admins.ts b/server/lib/notifier/shared/instance/new-peertube-version-for-admins.ts index 6b5ac808a..f5646c666 100644 --- a/server/lib/notifier/shared/instance/new-peertube-version-for-admins.ts +++ b/server/lib/notifier/shared/instance/new-peertube-version-for-admins.ts | |||
@@ -30,8 +30,8 @@ export class NewPeerTubeVersionForAdmins extends AbstractNotification <NewPeerTu | |||
30 | return this.admins | 30 | return this.admins |
31 | } | 31 | } |
32 | 32 | ||
33 | async createNotification (user: MUserWithNotificationSetting) { | 33 | createNotification (user: MUserWithNotificationSetting) { |
34 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 34 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
35 | type: UserNotificationType.NEW_PEERTUBE_VERSION, | 35 | type: UserNotificationType.NEW_PEERTUBE_VERSION, |
36 | userId: user.id, | 36 | userId: user.id, |
37 | applicationId: this.payload.application.id | 37 | applicationId: this.payload.application.id |
diff --git a/server/lib/notifier/shared/instance/new-plugin-version-for-admins.ts b/server/lib/notifier/shared/instance/new-plugin-version-for-admins.ts index 874b10a3d..547c6726c 100644 --- a/server/lib/notifier/shared/instance/new-plugin-version-for-admins.ts +++ b/server/lib/notifier/shared/instance/new-plugin-version-for-admins.ts | |||
@@ -26,8 +26,8 @@ export class NewPluginVersionForAdmins extends AbstractNotification <MPlugin> { | |||
26 | return this.admins | 26 | return this.admins |
27 | } | 27 | } |
28 | 28 | ||
29 | async createNotification (user: MUserWithNotificationSetting) { | 29 | createNotification (user: MUserWithNotificationSetting) { |
30 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 30 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
31 | type: UserNotificationType.NEW_PLUGIN_VERSION, | 31 | type: UserNotificationType.NEW_PLUGIN_VERSION, |
32 | userId: user.id, | 32 | userId: user.id, |
33 | pluginId: this.plugin.id | 33 | pluginId: this.plugin.id |
diff --git a/server/lib/notifier/shared/instance/registration-for-moderators.ts b/server/lib/notifier/shared/instance/registration-for-moderators.ts index 2a48ef2fa..e92467424 100644 --- a/server/lib/notifier/shared/instance/registration-for-moderators.ts +++ b/server/lib/notifier/shared/instance/registration-for-moderators.ts | |||
@@ -25,8 +25,8 @@ export class RegistrationForModerators extends AbstractNotification <MUserDefaul | |||
25 | return this.moderators | 25 | return this.moderators |
26 | } | 26 | } |
27 | 27 | ||
28 | async createNotification (user: MUserWithNotificationSetting) { | 28 | createNotification (user: MUserWithNotificationSetting) { |
29 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 29 | const notification = UserNotificationModel.build<UserNotificationModelForApi>({ |
30 | type: UserNotificationType.NEW_USER_REGISTRATION, | 30 | type: UserNotificationType.NEW_USER_REGISTRATION, |
31 | userId: user.id, | 31 | userId: user.id, |
32 | accountId: this.payload.Account.id | 32 | accountId: this.payload.Account.id |