]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/activitypub/actor.ts
Add scores to follows and remove bad ones
[github/Chocobozzz/PeerTube.git] / server / models / activitypub / actor.ts
index b88e06b41a6eb2db3702cca9767db42df54132de..912d8d748b97b1319ce85530efb2aec7723da7d4 100644 (file)
@@ -204,7 +204,7 @@ export class ActorModel extends Model<ActorModel> {
   VideoChannel: VideoChannelModel
 
   static load (id: number) {
-    return ActorModel.scope(ScopeNames.FULL).findById(id)
+    return ActorModel.unscoped().findById(id)
   }
 
   static listByFollowersUrls (followersUrls: string[], transaction?: Sequelize.Transaction) {
@@ -267,20 +267,17 @@ export class ActorModel extends Model<ActorModel> {
       avatar = this.Avatar.toFormattedJSON()
     }
 
-    let score: number
-    if (this.Server) {
-      score = this.Server.score
-    }
-
     return {
       id: this.id,
       url: this.url,
       uuid: this.uuid,
+      name: this.preferredUsername,
       host: this.getHost(),
-      score,
       followingCount: this.followingCount,
       followersCount: this.followersCount,
-      avatar
+      avatar,
+      createdAt: this.createdAt,
+      updatedAt: this.updatedAt
     }
   }