]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/activitypub/actor-follow.ts
Fix videos list user NSFW policy
[github/Chocobozzz/PeerTube.git] / server / models / activitypub / actor-follow.ts
index ebb2d47c263bba185c82220ef514e98de3194683..27bb43daedf6d729418a70d75d11339a00bc5afa 100644 (file)
@@ -19,7 +19,7 @@ import {
   UpdatedAt
 } from 'sequelize-typescript'
 import { FollowState } from '../../../shared/models/actors'
-import { AccountFollow } from '../../../shared/models/actors/follow.model'
+import { ActorFollow } from '../../../shared/models/actors/follow.model'
 import { logger } from '../../helpers/logger'
 import { getServerActor } from '../../helpers/utils'
 import { ACTOR_FOLLOW_SCORE } from '../../initializers'
@@ -325,15 +325,13 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
       },
       include: [
         {
-          attributes: {
-            exclude: unusedActorAttributesForAPI
-          },
-          model: ActorModel,
+          attributes: [ 'id' ],
+          model: ActorModel.unscoped(),
           as: 'ActorFollowing',
           required: true,
           include: [
             {
-              model: VideoChannelModel,
+              model: VideoChannelModel.unscoped(),
               required: true,
               include: [
                 {
@@ -344,7 +342,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
                   required: true
                 },
                 {
-                  model: AccountModel,
+                  model: AccountModel.unscoped(),
                   required: true,
                   include: [
                     {
@@ -531,7 +529,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
     return ActorFollowModel.findAll(query)
   }
 
-  toFormattedJSON (): AccountFollow {
+  toFormattedJSON (): ActorFollow {
     const follower = this.ActorFollower.toFormattedJSON()
     const following = this.ActorFollowing.toFormattedJSON()