summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/Actor/Person.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-06-20 22:59:40 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-06-20 22:59:40 -0100
commita1221cacf6dc9dbdffc1929f361e9c2e942c049d (patch)
tree51977745153fb5ba074d01773e47c219d11dfeec /lib/Model/ActivityPub/Actor/Person.php
parent74a2f80209733543c48035184c2321158a0e2da3 (diff)
new announce system
Signed-off-by: Maxence Lange <maxence@artificial-owl.com> gotActor->hasActor Signed-off-by: Maxence Lange <maxence@artificial-owl.com> cleaning Signed-off-by: Maxence Lange <maxence@artificial-owl.com> retrieve Person if missing Signed-off-by: Maxence Lange <maxence@artificial-owl.com> fix async Signed-off-by: Maxence Lange <maxence@artificial-owl.com> avoid async duplicate Signed-off-by: Maxence Lange <maxence@artificial-owl.com> fixing 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.php78
1 files changed, 6 insertions, 72 deletions
diff --git a/lib/Model/ActivityPub/Actor/Person.php b/lib/Model/ActivityPub/Actor/Person.php
index bd94f035..af2ebfd9 100644
--- a/lib/Model/ActivityPub/Actor/Person.php
+++ b/lib/Model/ActivityPub/Actor/Person.php
@@ -41,6 +41,7 @@ use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Image;
+use OCA\Social\Traits\TDetails;
/**
@@ -51,6 +52,9 @@ use OCA\Social\Model\ActivityPub\Object\Image;
class Person extends ACore implements JsonSerializable {
+ use TDetails;
+
+
const TYPE = 'Person';
@@ -93,9 +97,6 @@ class Person extends ACore implements JsonSerializable {
/** @var string */
private $featured = '';
- /** @var array */
- private $details = [];
-
/** @var int */
private $avatarVersion = -1;
@@ -359,73 +360,6 @@ class Person extends ACore implements JsonSerializable {
/**
- * @return array
- */
- public function getDetails(): array {
- return $this->details;
- }
-
- /**
- * @param string $detail
- * @param string $value
- *
- * @return Person
- */
- public function addDetail(string $detail, string $value): Person {
- $this->details[$detail] = $value;
-
- return $this;
- }
-
- /**
- * @param string $detail
- * @param int $value
- *
- * @return Person
- */
- public function addDetailInt(string $detail, int $value): Person {
- $this->details[$detail] = $value;
-
- return $this;
- }
-
- /**
- * @param string $detail
- * @param array $value
- *
- * @return Person
- */
- public function addDetailArray(string $detail, array $value): Person {
- $this->details[$detail] = $value;
-
- return $this;
- }
-
- /**
- * @param string $detail
- * @param bool $value
- *
- * @return Person
- */
- public function addDetailBool(string $detail, bool $value): Person {
- $this->details[$detail] = $value;
-
- return $this;
- }
-
- /**
- * @param array $details
- *
- * @return Person
- */
- public function setDetails(array $details): Person {
- $this->details = $details;
-
- return $this;
- }
-
-
- /**
* @return int
*/
public function getAvatarVersion(): int {
@@ -497,7 +431,7 @@ 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, []));
+ ->setDetailsAll($this->getArray('details', $data, []));
try {
$dTime = new DateTime($this->get('creation', $data, 'yesterday'));
@@ -536,7 +470,7 @@ class Person extends ACore implements JsonSerializable {
);
if ($this->isCompleteDetails()) {
- $result['details'] = $this->getDetails();
+ $result['details'] = $this->getDetailsAll();
}
return $result;