summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/Actor/Person.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-02 10:20:11 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-02 23:49:00 -0100
commitdd30d98cac596cddcbf4a9f56a88807c8c4fe356 (patch)
tree10afab8d21508c4dd76f10b1f944499c8e3d2794 /lib/Model/ActivityPub/Actor/Person.php
parent43fc850c18398bded7884c804b94daab80dabca8 (diff)
refresh keys after 7 days
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model/ActivityPub/Actor/Person.php')
-rw-r--r--lib/Model/ActivityPub/Actor/Person.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Model/ActivityPub/Actor/Person.php b/lib/Model/ActivityPub/Actor/Person.php
index 5d215fda..6383ca03 100644
--- a/lib/Model/ActivityPub/Actor/Person.php
+++ b/lib/Model/ActivityPub/Actor/Person.php
@@ -31,6 +31,7 @@ declare(strict_types=1);
namespace OCA\Social\Model\ActivityPub\Actor;
+use DateTime;
use JsonSerializable;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore;
@@ -474,7 +475,12 @@ class Person extends ACore implements JsonSerializable {
*/
public function importFromDatabase(array $data) {
parent::importFromDatabase($data);
- $this->setPreferredUsername($this->validate(self::AS_USERNAME, 'preferred_username', $data, ''))
+
+ $dTime = new DateTime($this->get('creation', $data, 'yesterday'));
+
+ $this->setPreferredUsername(
+ $this->validate(self::AS_USERNAME, 'preferred_username', $data, '')
+ )
->setName($this->validate(self::AS_USERNAME, 'name', $data, ''))
->setAccount($this->validate(self::AS_ACCOUNT, 'account', $data, ''))
->setPublicKey($this->get('public_key', $data, ''))
@@ -486,7 +492,7 @@ class Person extends ACore implements JsonSerializable {
->setSharedInbox($this->validate(self::AS_URL, 'shared_inbox', $data, ''))
->setFeatured($this->validate(self::AS_URL, 'featured', $data, ''))
->setDetails($this->getArray('details', $data, []))
- ->setCreation($this->getInt('creation', $data, 0));
+ ->setCreation($dTime->getTimestamp());
}