diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-06-20 22:59:40 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-06-20 22:59:40 -0100 |
commit | a1221cacf6dc9dbdffc1929f361e9c2e942c049d (patch) | |
tree | 51977745153fb5ba074d01773e47c219d11dfeec /lib/Model/ActivityPub/Stream.php | |
parent | 74a2f80209733543c48035184c2321158a0e2da3 (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/Stream.php')
-rw-r--r-- | lib/Model/ActivityPub/Stream.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php index 8aa2f3c7..d8585927 100644 --- a/lib/Model/ActivityPub/Stream.php +++ b/lib/Model/ActivityPub/Stream.php @@ -36,11 +36,15 @@ use DateTime; use Exception; use JsonSerializable; use OCA\Social\Model\StreamAction; +use OCA\Social\Traits\TDetails; class Stream extends ACore implements JsonSerializable { + use TDetails; + + const TYPE = 'Stream'; @@ -48,6 +52,7 @@ class Stream extends ACore implements JsonSerializable { const TYPE_UNLISTED = 'unlisted'; const TYPE_FOLLOWERS = 'followers'; const TYPE_DIRECT = 'direct'; + const TYPE_ANNOUNCE = 'announce'; /** @var string */ @@ -81,6 +86,11 @@ class Stream extends ACore implements JsonSerializable { private $hiddenOnTimeline = false; + /** + * Stream constructor. + * + * @param null $parent + */ public function __construct($parent = null) { parent::__construct($parent); } @@ -346,6 +356,7 @@ class Stream extends ACore implements JsonSerializable { $this->setObjectId($this->validate(self::AS_ID, 'object_id', $data, '')); $this->setAttributedTo($this->validate(self::AS_ID, 'attributed_to', $data, '')); $this->setInReplyTo($this->validate(self::AS_ID, 'in_reply_to', $data)); + $this->setDetailsAll($this->getArray('details', $data, [])); $this->setHiddenOnTimeline($this->getBool('hidden_on_timeline', $data, false)); $cache = new Cache(); @@ -375,11 +386,16 @@ class Stream extends ACore implements JsonSerializable { $result = array_merge( $result, [ + 'details' => $this->getDetailsAll(), 'action' => ($this->hasAction()) ? $this->getAction() : [], 'cache' => ($this->hasCache()) ? $this->getCache() : '', 'publishedTime' => $this->getPublishedTime() ] ); + + $result['cc'] = ''; + $result['bcc'] = ''; + $result['to'] = ''; } $this->cleanArray($result); |