diff options
Diffstat (limited to 'server/models/activitypub/actor.ts')
-rw-r--r-- | server/models/activitypub/actor.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 19f3f7e04..1af9efac2 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -69,9 +69,7 @@ export const unusedActorAttributesForAPI = [ | |||
69 | 'outboxUrl', | 69 | 'outboxUrl', |
70 | 'sharedInboxUrl', | 70 | 'sharedInboxUrl', |
71 | 'followersUrl', | 71 | 'followersUrl', |
72 | 'followingUrl', | 72 | 'followingUrl' |
73 | 'createdAt', | ||
74 | 'updatedAt' | ||
75 | ] | 73 | ] |
76 | 74 | ||
77 | @DefaultScope(() => ({ | 75 | @DefaultScope(() => ({ |
@@ -222,6 +220,10 @@ export class ActorModel extends Model { | |||
222 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) | 220 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) |
223 | followingUrl: string | 221 | followingUrl: string |
224 | 222 | ||
223 | @AllowNull(true) | ||
224 | @Column | ||
225 | remoteCreatedAt: Date | ||
226 | |||
225 | @CreatedAt | 227 | @CreatedAt |
226 | createdAt: Date | 228 | createdAt: Date |
227 | 229 | ||
@@ -555,8 +557,7 @@ export class ActorModel extends Model { | |||
555 | followingCount: this.followingCount, | 557 | followingCount: this.followingCount, |
556 | followersCount: this.followersCount, | 558 | followersCount: this.followersCount, |
557 | banner, | 559 | banner, |
558 | createdAt: this.createdAt, | 560 | createdAt: this.getCreatedAt() |
559 | updatedAt: this.updatedAt | ||
560 | }) | 561 | }) |
561 | } | 562 | } |
562 | 563 | ||
@@ -608,6 +609,7 @@ export class ActorModel extends Model { | |||
608 | owner: this.url, | 609 | owner: this.url, |
609 | publicKeyPem: this.publicKey | 610 | publicKeyPem: this.publicKey |
610 | }, | 611 | }, |
612 | published: this.getCreatedAt().toISOString(), | ||
611 | icon, | 613 | icon, |
612 | image | 614 | image |
613 | } | 615 | } |
@@ -690,4 +692,8 @@ export class ActorModel extends Model { | |||
690 | 692 | ||
691 | return isOutdated(this, ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL) | 693 | return isOutdated(this, ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL) |
692 | } | 694 | } |
695 | |||
696 | getCreatedAt (this: MActorAPChannel | MActorAPAccount | MActorFormattable) { | ||
697 | return this.remoteCreatedAt || this.createdAt | ||
698 | } | ||
693 | } | 699 | } |