From f7cc67b455a12ccae9b0ea16876d166720364357 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 4 Jan 2019 08:56:20 +0100 Subject: Add new follow, mention and user registered notifs --- .../users/user-notification-setting.model.ts | 3 +++ shared/models/users/user-notification.model.ts | 24 +++++++++++++++++++++- shared/models/users/user-right.enum.ts | 5 +++++ shared/models/users/user-role.ts | 3 ++- 4 files changed, 33 insertions(+), 2 deletions(-) (limited to 'shared/models/users') diff --git a/shared/models/users/user-notification-setting.model.ts b/shared/models/users/user-notification-setting.model.ts index 55d351abf..f580e827e 100644 --- a/shared/models/users/user-notification-setting.model.ts +++ b/shared/models/users/user-notification-setting.model.ts @@ -12,4 +12,7 @@ export interface UserNotificationSetting { blacklistOnMyVideo: UserNotificationSettingValue myVideoPublished: UserNotificationSettingValue myVideoImportFinished: UserNotificationSettingValue + newUserRegistration: UserNotificationSettingValue + newFollow: UserNotificationSettingValue + commentMention: UserNotificationSettingValue } diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts index ee9ac275a..9dd4f099f 100644 --- a/shared/models/users/user-notification.model.ts +++ b/shared/models/users/user-notification.model.ts @@ -6,7 +6,10 @@ export enum UserNotificationType { UNBLACKLIST_ON_MY_VIDEO = 5, MY_VIDEO_PUBLISHED = 6, MY_VIDEO_IMPORT_SUCCESS = 7, - MY_VIDEO_IMPORT_ERROR = 8 + MY_VIDEO_IMPORT_ERROR = 8, + NEW_USER_REGISTRATION = 9, + NEW_FOLLOW = 10, + COMMENT_MENTION = 11 } export interface VideoInfo { @@ -55,6 +58,25 @@ export interface UserNotification { video: VideoInfo } + account?: { + id: number + displayName: string + name: string + } + + actorFollow?: { + id: number + follower: { + name: string + displayName: string + } + following: { + type: 'account' | 'channel' + name: string + displayName: string + } + } + createdAt: string updatedAt: string } diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts index 51c59d20a..090256bca 100644 --- a/shared/models/users/user-right.enum.ts +++ b/shared/models/users/user-right.enum.ts @@ -2,10 +2,15 @@ export enum UserRight { ALL, MANAGE_USERS, + MANAGE_SERVER_FOLLOW, + MANAGE_SERVER_REDUNDANCY, + MANAGE_VIDEO_ABUSES, + MANAGE_JOBS, + MANAGE_CONFIGURATION, MANAGE_ACCOUNTS_BLOCKLIST, diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts index adef8fd95..59c2ba106 100644 --- a/shared/models/users/user-role.ts +++ b/shared/models/users/user-role.ts @@ -29,7 +29,8 @@ const userRoleRights: { [ id: number ]: UserRight[] } = { UserRight.UPDATE_ANY_VIDEO, UserRight.SEE_ALL_VIDEOS, UserRight.MANAGE_ACCOUNTS_BLOCKLIST, - UserRight.MANAGE_SERVERS_BLOCKLIST + UserRight.MANAGE_SERVERS_BLOCKLIST, + UserRight.MANAGE_USERS ], [UserRole.USER]: [] -- cgit v1.2.3