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 --- .../lib/notifier/shared/instance/new-peertube-version-for-admins.ts | 4 ++-- server/lib/notifier/shared/instance/new-plugin-version-for-admins.ts | 4 ++-- server/lib/notifier/shared/instance/registration-for-moderators.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/lib/notifier/shared/instance') 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 ({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.NEW_PEERTUBE_VERSION, userId: user.id, 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 { return this.admins } - async createNotification (user: MUserWithNotificationSetting) { - const notification = await UserNotificationModel.create({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.NEW_PLUGIN_VERSION, userId: user.id, 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 ({ + createNotification (user: MUserWithNotificationSetting) { + const notification = UserNotificationModel.build({ type: UserNotificationType.NEW_USER_REGISTRATION, userId: user.id, accountId: this.payload.Account.id -- cgit v1.2.3