diff options
Diffstat (limited to 'lib/Model/ActivityPub/Stream.php')
-rw-r--r-- | lib/Model/ActivityPub/Stream.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php index ad55eee1..5a19deb3 100644 --- a/lib/Model/ActivityPub/Stream.php +++ b/lib/Model/ActivityPub/Stream.php @@ -78,6 +78,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { private string $attributedTo = ''; private string $inReplyTo = ''; private array $attachments = []; + private array $mentions = []; private bool $sensitive = false; private string $conversation = ''; private ?Cache $cache = null; @@ -247,6 +248,17 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { } + public function getMentions(): array { + return $this->mentions; + } + + public function setMentions(array $mentions): self { + $this->mentions = $mentions; + + return $this; + } + + /** * @return bool */ @@ -434,7 +446,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { */ public function importAttachments(array $list): void { $urlGenerator = Server::get(IURLGenerator::class); - + $new = []; foreach ($list as $item) { try { @@ -495,6 +507,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { $this->setDetailsAll($this->getArray('details', $data, [])); $this->setFilterDuplicate($this->getBool('filter_duplicate', $data, false)); $this->setAttachments($this->getArray('attachments', $data, [])); + $this->setMentions($this->getDetails('mentions')); $this->setVisibility($this->get('visibility', $data)); $cache = new Cache(); @@ -547,6 +560,8 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { } $this->setAttachments($attachments); + $this->setMentions($this->getArray('mentions', $data)); + // import from cache with new format ! $actor = new Person(); $actor->importFromLocal($this->getArray('account', $data)); @@ -619,6 +634,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { "language" => $this->getLanguage(), "in_reply_to_id" => null, "in_reply_to_account_id" => null, + 'mentions' => $this->getMentions(), 'replies_count' => 0, 'reblogs_count' => 0, 'favourites_count' => 0, |