Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't include banners in account API

Chocobozzzb65d639695e2
diff --git a/server/core/models/account/account.ts b/server/core/models/account/account.ts
index 0611fb25f2..518794ad74 100644
--- a/server/core/models/account/account.ts
+++ b/server/core/models/account/account.ts
@@ -408,7 +408,7 @@ export class AccountModel extends SequelizeModel<AccountModel> {
toFormattedJSON (this: MAccountFormattable): Account {
return {
- ...this.Actor.toFormattedJSON(),
+ ...this.Actor.toFormattedJSON(false),
id: this.id,
displayName: this.getDisplayName(),
diff --git a/server/core/models/actor/actor.ts b/server/core/models/actor/actor.ts
index 1ec75bb22b..d9586a9d7e 100644
--- a/server/core/models/actor/actor.ts
+++ b/server/core/models/actor/actor.ts
@@ -542,7 +542,7 @@ export class ActorModel extends SequelizeModel<ActorModel> {
}
}
- toFormattedJSON (this: MActorFormattable) {
+ toFormattedJSON (this: MActorFormattable, includeBanner = true) {
return {
...this.toFormattedSummaryJSON(),
@@ -552,7 +552,9 @@ export class ActorModel extends SequelizeModel<ActorModel> {
followersCount: this.followersCount,
createdAt: this.getCreatedAt(),
- banners: (this.Banners || []).map(b => b.toFormattedJSON())
+ banners: includeBanner
+ ? (this.Banners || []).map(b => b.toFormattedJSON())
+ : undefined
}
}