aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-08 17:26:01 +0200
committerChocobozzz <me@florianbigard.com>2019-04-08 17:30:48 +0200
commit883993c81ecc2388d4a4b37b29b81b6de73d264f (patch)
treef0f76995b6762b10a0c1a7ccc2b5d952f68014ea /server/models
parent0dc647775881eb1378b213a530996cd096de24ea (diff)
downloadPeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.tar.gz
PeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.tar.zst
PeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.zip
Add notification on new instance follower (server side)
Diffstat (limited to 'server/models')
-rw-r--r--server/models/account/user-notification-setting.ts12
-rw-r--r--server/models/account/user-notification.ts1
2 files changed, 12 insertions, 1 deletions
diff --git a/server/models/account/user-notification-setting.ts b/server/models/account/user-notification-setting.ts
index ba7f739b9..c2fbc6d23 100644
--- a/server/models/account/user-notification-setting.ts
+++ b/server/models/account/user-notification-setting.ts
@@ -104,6 +104,15 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
104 @AllowNull(false) 104 @AllowNull(false)
105 @Default(null) 105 @Default(null)
106 @Is( 106 @Is(
107 'UserNotificationSettingNewInstanceFollower',
108 value => throwIfNotValid(value, isUserNotificationSettingValid, 'newInstanceFollower')
109 )
110 @Column
111 newInstanceFollower: UserNotificationSettingValue
112
113 @AllowNull(false)
114 @Default(null)
115 @Is(
107 'UserNotificationSettingNewFollow', 116 'UserNotificationSettingNewFollow',
108 value => throwIfNotValid(value, isUserNotificationSettingValid, 'newFollow') 117 value => throwIfNotValid(value, isUserNotificationSettingValid, 'newFollow')
109 ) 118 )
@@ -154,7 +163,8 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
154 myVideoImportFinished: this.myVideoImportFinished, 163 myVideoImportFinished: this.myVideoImportFinished,
155 newUserRegistration: this.newUserRegistration, 164 newUserRegistration: this.newUserRegistration,
156 commentMention: this.commentMention, 165 commentMention: this.commentMention,
157 newFollow: this.newFollow 166 newFollow: this.newFollow,
167 newInstanceFollower: this.newInstanceFollower
158 } 168 }
159 } 169 }
160} 170}
diff --git a/server/models/account/user-notification.ts b/server/models/account/user-notification.ts
index 6cdbb827b..ccf8277ab 100644
--- a/server/models/account/user-notification.ts
+++ b/server/models/account/user-notification.ts
@@ -418,6 +418,7 @@ export class UserNotificationModel extends Model<UserNotificationModel> {
418 418
419 const actorFollow = this.ActorFollow ? { 419 const actorFollow = this.ActorFollow ? {
420 id: this.ActorFollow.id, 420 id: this.ActorFollow.id,
421 state: this.ActorFollow.state,
421 follower: { 422 follower: {
422 id: this.ActorFollow.ActorFollower.Account.id, 423 id: this.ActorFollow.ActorFollower.Account.id,
423 displayName: this.ActorFollow.ActorFollower.Account.getDisplayName(), 424 displayName: this.ActorFollow.ActorFollower.Account.getDisplayName(),