summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/Actor/Person.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-03 10:36:46 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-03 10:36:46 -0100
commit3e8694ff530d28465d0afc7a7a4e43e0707ee604 (patch)
tree83b029168a48266b7afcc253dfb74aab8b5d9ffd /lib/Model/ActivityPub/Actor/Person.php
parentf54b346bd033e46ef3cc19d6f5b4c0ade11e6c37 (diff)
using AP object to generate items so UrlCloud is set by default
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.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Model/ActivityPub/Actor/Person.php b/lib/Model/ActivityPub/Actor/Person.php
index 6383ca03..0024eb69 100644
--- a/lib/Model/ActivityPub/Actor/Person.php
+++ b/lib/Model/ActivityPub/Actor/Person.php
@@ -33,6 +33,9 @@ namespace OCA\Social\Model\ActivityPub\Actor;
use DateTime;
use JsonSerializable;
+use OCA\Social\AP;
+use OCA\Social\Exceptions\ItemUnknownException;
+use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Image;
@@ -442,6 +445,8 @@ class Person extends ACore implements JsonSerializable {
/**
* @param array $data
*
+ * @throws ItemUnknownException
+ * @throws SocialAppConfigException
* @throws UrlCloudException
*/
public function import(array $data) {
@@ -459,8 +464,8 @@ class Person extends ACore implements JsonSerializable {
->setFollowing($this->validate(ACore::AS_URL, 'following', $data, ''))
->setFeatured($this->validate(ACore::AS_URL, 'featured', $data, ''));
- $icon = new Image($this);
- $icon->setUrlCloud($this->getUrlCloud());
+ /** @var Image $icon */
+ $icon = AP::$activityPub->getItemFromType(Image::TYPE);
$icon->import($this->getArray('icon', $data, []));
if ($icon->getType() === Image::TYPE) {