aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/actor/actor.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/actor/actor.ts')
-rw-r--r--server/models/actor/actor.ts21
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 }