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'
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,
MVideoBlacklistLightVideo,
MVideoBlacklistVideo,
MVideoFullLight
-} from '../typings/models/video'
+} from '../types/models/video'
import { isBlockedByServerOrAccount } from './blocklist'
import { Emailer } from './emailer'
import { PeerTubeSocket } from './peertube-socket'
}
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)
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS,
+ type: UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS,
userId: user.id,
videoBlacklistId: videoBlacklist.id
})
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.BLOCK_ON_MY_VIDEO,
+ type: UserNotificationType.BLACKLIST_ON_MY_VIDEO,
userId: user.id,
videoBlacklistId: videoBlacklist.id
})
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.UNBLOCK_ON_MY_VIDEO,
+ type: UserNotificationType.UNBLACKLIST_ON_MY_VIDEO,
userId: user.id,
videoId: video.id
})