]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/actor.ts
Fix remote actor creation date
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / actor.ts
index eec951d4ea6478dc3c372156bfb98ea1f3e25ac8..34d53bd52e4055aaf6064a9a18a1ca6eb88eb7be 100644 (file)
@@ -154,6 +154,8 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activ
   const followersCount = await fetchActorTotalItems(attributes.followers)
   const followingCount = await fetchActorTotalItems(attributes.following)
 
+  logger.info('coucou', { attributes })
+
   actorInstance.type = attributes.type
   actorInstance.preferredUsername = attributes.preferredUsername
   actorInstance.url = attributes.id
@@ -165,6 +167,8 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activ
   actorInstance.followersUrl = attributes.followers
   actorInstance.followingUrl = attributes.following
 
+  if (attributes.published) actorInstance.remoteCreatedAt = new Date(attributes.published)
+
   if (attributes.endpoints?.sharedInbox) {
     actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox
   }