diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-05-17 09:19:45 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-05-17 09:19:45 -0100 |
commit | ec822a440bbc9b81005921c6430640d5388e5289 (patch) | |
tree | d18c239a7dd38679001ffd5747f2b3988aa0b58f /lib/Model/ActivityPub/Actor/Person.php | |
parent | 1ad4d54ac76c54def69158669dd785dad3d2233e (diff) |
cleaning code
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.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Model/ActivityPub/Actor/Person.php b/lib/Model/ActivityPub/Actor/Person.php index 61def8cc..bd94f035 100644 --- a/lib/Model/ActivityPub/Actor/Person.php +++ b/lib/Model/ActivityPub/Actor/Person.php @@ -32,6 +32,7 @@ namespace OCA\Social\Model\ActivityPub\Actor; use DateTime; +use Exception; use JsonSerializable; use OCA\Social\AP; use OCA\Social\Exceptions\InvalidOriginException; @@ -483,8 +484,6 @@ class Person extends ACore implements JsonSerializable { public function importFromDatabase(array $data) { parent::importFromDatabase($data); - $dTime = new DateTime($this->get('creation', $data, 'yesterday')); - $this->setPreferredUsername( $this->validate(self::AS_USERNAME, 'preferred_username', $data, '') ) @@ -498,8 +497,13 @@ class Person extends ACore implements JsonSerializable { ->setFollowing($this->validate(self::AS_URL, 'following', $data, '')) ->setSharedInbox($this->validate(self::AS_URL, 'shared_inbox', $data, '')) ->setFeatured($this->validate(self::AS_URL, 'featured', $data, '')) - ->setDetails($this->getArray('details', $data, [])) - ->setCreation($dTime->getTimestamp()); + ->setDetails($this->getArray('details', $data, [])); + + try { + $dTime = new DateTime($this->get('creation', $data, 'yesterday')); + $this->setCreation($dTime->getTimestamp()); + } catch (Exception $e) { + } } |