diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:28:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:41:14 +0200 |
commit | f932957b2e33da0b6d9a29dd98281b28f220a77a (patch) | |
tree | 71ada3f7308e83730d607312385170dc489da422 /server/models/actor/actor.ts | |
parent | 89aa3331106874266f6feeee7bff852da2c1727e (diff) | |
download | PeerTube-f932957b2e33da0b6d9a29dd98281b28f220a77a.tar.gz PeerTube-f932957b2e33da0b6d9a29dd98281b28f220a77a.tar.zst PeerTube-f932957b2e33da0b6d9a29dd98281b28f220a77a.zip |
Remove banner/avatar fields from channel/account
Deprecated since 4.2
Diffstat (limited to 'server/models/actor/actor.ts')
-rw-r--r-- | server/models/actor/actor.ts | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/server/models/actor/actor.ts b/server/models/actor/actor.ts index dccb47a10..e2e85f3d6 100644 --- a/server/models/actor/actor.ts +++ b/server/models/actor/actor.ts | |||
@@ -540,12 +540,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> { | |||
540 | url: this.url, | 540 | url: this.url, |
541 | name: this.preferredUsername, | 541 | name: this.preferredUsername, |
542 | host: this.getHost(), | 542 | host: this.getHost(), |
543 | avatars: (this.Avatars || []).map(a => a.toFormattedJSON()), | 543 | avatars: (this.Avatars || []).map(a => a.toFormattedJSON()) |
544 | |||
545 | // TODO: remove, deprecated in 4.2 | ||
546 | avatar: this.hasImage(ActorImageType.AVATAR) | ||
547 | ? this.Avatars[0].toFormattedJSON() | ||
548 | : undefined | ||
549 | } | 544 | } |
550 | } | 545 | } |
551 | 546 | ||
@@ -559,23 +554,16 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> { | |||
559 | followersCount: this.followersCount, | 554 | followersCount: this.followersCount, |
560 | createdAt: this.getCreatedAt(), | 555 | createdAt: this.getCreatedAt(), |
561 | 556 | ||
562 | banners: (this.Banners || []).map(b => b.toFormattedJSON()), | 557 | banners: (this.Banners || []).map(b => b.toFormattedJSON()) |
563 | |||
564 | // TODO: remove, deprecated in 4.2 | ||
565 | banner: this.hasImage(ActorImageType.BANNER) | ||
566 | ? this.Banners[0].toFormattedJSON() | ||
567 | : undefined | ||
568 | } | 558 | } |
569 | } | 559 | } |
570 | 560 | ||
571 | toActivityPubObject (this: MActorAPChannel | MActorAPAccount, name: string) { | 561 | toActivityPubObject (this: MActorAPChannel | MActorAPAccount, name: string) { |
572 | let icon: ActivityIconObject | 562 | let icon: ActivityIconObject[] |
573 | let icons: ActivityIconObject[] | ||
574 | let image: ActivityIconObject | 563 | let image: ActivityIconObject |
575 | 564 | ||
576 | if (this.hasImage(ActorImageType.AVATAR)) { | 565 | if (this.hasImage(ActorImageType.AVATAR)) { |
577 | icon = getBiggestActorImage(this.Avatars).toActivityPubObject() | 566 | icon = this.Avatars.map(a => a.toActivityPubObject()) |
578 | icons = this.Avatars.map(a => a.toActivityPubObject()) | ||
579 | } | 567 | } |
580 | 568 | ||
581 | if (this.hasImage(ActorImageType.BANNER)) { | 569 | if (this.hasImage(ActorImageType.BANNER)) { |
@@ -613,7 +601,6 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> { | |||
613 | published: this.getCreatedAt().toISOString(), | 601 | published: this.getCreatedAt().toISOString(), |
614 | 602 | ||
615 | icon, | 603 | icon, |
616 | icons, | ||
617 | 604 | ||
618 | image | 605 | image |
619 | } | 606 | } |