]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/user-notification-setting.ts
Add auto follow back support for instances
[github/Chocobozzz/PeerTube.git] / server / models / account / user-notification-setting.ts
index 1506295cf7f7183ad9e6b2c29fac9bb32e86fd9d..dc69a17fda585fa61e0aa329d30a2b326be02046 100644 (file)
@@ -111,6 +111,15 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
   @Column
   newInstanceFollower: UserNotificationSettingValue
 
+  @AllowNull(false)
+  @Default(null)
+  @Is(
+    'UserNotificationSettingNewInstanceFollower',
+    value => throwIfNotValid(value, isUserNotificationSettingValid, 'autoInstanceFollowing')
+  )
+  @Column
+  autoInstanceFollowing: UserNotificationSettingValue
+
   @AllowNull(false)
   @Default(null)
   @Is(
@@ -165,7 +174,8 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
       newUserRegistration: this.newUserRegistration,
       commentMention: this.commentMention,
       newFollow: this.newFollow,
-      newInstanceFollower: this.newInstanceFollower
+      newInstanceFollower: this.newInstanceFollower,
+      autoInstanceFollowing: this.autoInstanceFollowing
     }
   }
 }