X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fnotifier.ts;h=943a087d2e8315bb575b29803aa5b03403c3a813;hb=963023abe6acf31799f6474d78489c8013f664fa;hp=3e90bb57e8a461a38ae9aa06c4c939f44810c023;hpb=5baee5fca418487e72ddcd6419d31bca8659b668;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts index 3e90bb57e..943a087d2 100644 --- a/server/lib/notifier.ts +++ b/server/lib/notifier.ts @@ -7,8 +7,8 @@ import { MUserNotifSettingAccount, MUserWithNotificationSetting, UserNotificationModelForApi -} from '@server/typings/models/user' -import { MVideoImportVideo } from '@server/typings/models/video/video-import' +} from '@server/types/models/user' +import { MVideoImportVideo } from '@server/types/models/video/video-import' import { UserNotificationSettingValue, UserNotificationType, UserRight } from '../../shared/models/users' import { VideoAbuse, VideoPrivacy, VideoState } from '../../shared/models/videos' import { logger } from '../helpers/logger' @@ -16,7 +16,7 @@ import { CONFIG } from '../initializers/config' import { AccountBlocklistModel } from '../models/account/account-blocklist' import { UserModel } from '../models/account/user' import { UserNotificationModel } from '../models/account/user-notification' -import { MAccountServer, MActorFollowFull } from '../typings/models' +import { MAccountServer, MActorFollowFull } from '../types/models' import { MCommentOwnerVideo, MVideoAbuseVideo, @@ -24,7 +24,7 @@ import { MVideoBlacklistLightVideo, MVideoBlacklistVideo, MVideoFullLight -} from '../typings/models/video' +} from '../types/models/video' import { isBlockedByServerOrAccount } from './blocklist' import { Emailer } from './emailer' import { PeerTubeSocket } from './peertube-socket' @@ -387,7 +387,7 @@ class Notifier { } private async notifyModeratorsOfVideoAutoBlacklist (videoBlacklist: MVideoBlacklistLightVideo) { - const moderators = await UserModel.listWithRight(UserRight.MANAGE_VIDEO_BLOCKS) + const moderators = await UserModel.listWithRight(UserRight.MANAGE_VIDEO_BLACKLIST) if (moderators.length === 0) return logger.info('Notifying %s moderators of video auto-blacklist %s.', moderators.length, videoBlacklist.Video.url) @@ -398,7 +398,7 @@ class Notifier { async function notificationCreator (user: MUserWithNotificationSetting) { const notification = await UserNotificationModel.create({ - type: UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS, + type: UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS, userId: user.id, videoBlacklistId: videoBlacklist.id }) @@ -426,7 +426,7 @@ class Notifier { async function notificationCreator (user: MUserWithNotificationSetting) { const notification = await UserNotificationModel.create({ - type: UserNotificationType.BLOCK_ON_MY_VIDEO, + type: UserNotificationType.BLACKLIST_ON_MY_VIDEO, userId: user.id, videoBlacklistId: videoBlacklist.id }) @@ -454,7 +454,7 @@ class Notifier { async function notificationCreator (user: MUserWithNotificationSetting) { const notification = await UserNotificationModel.create({ - type: UserNotificationType.UNBLOCK_ON_MY_VIDEO, + type: UserNotificationType.UNBLACKLIST_ON_MY_VIDEO, userId: user.id, videoId: video.id })