summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/Stream.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-02-22 23:04:00 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-02-22 23:04:00 -0100
commit9ac8eb965b930110d0ec42d56988a10adf1e3f96 (patch)
tree85234dfae2e24b53a42e17e2abb087b53aa085e1 /lib/Model/ActivityPub/Stream.php
parent8a92d5680abfa80302dafb421699ceb0d0aa74fc (diff)
boost creation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model/ActivityPub/Stream.php')
-rw-r--r--lib/Model/ActivityPub/Stream.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php
index c24e4fb2..f9cf86f2 100644
--- a/lib/Model/ActivityPub/Stream.php
+++ b/lib/Model/ActivityPub/Stream.php
@@ -293,13 +293,13 @@ class Stream extends ACore implements JsonSerializable {
* @return array
*/
public function jsonSerialize(): array {
- $this->addEntryInt('publishedTime', $this->getPublishedTime());
-
$result = array_merge(
parent::jsonSerialize(),
[
'content' => $this->getContent(),
- 'attributedTo' => $this->getUrlSocial() . $this->getAttributedTo(),
+ 'attributedTo' => ($this->getAttributedTo() !== '') ? $this->getUrlSocial()
+ . $this->getAttributedTo(
+ ) : '',
'inReplyTo' => $this->getInReplyTo(),
'sensitive' => $this->isSensitive(),
'conversation' => $this->getConversation()
@@ -310,11 +310,14 @@ class Stream extends ACore implements JsonSerializable {
$result = array_merge(
$result,
[
- 'cache' => $this->getCache()
+ 'cache' => ($this->gotCache()) ? $this->getCache() : '',
+ 'publishedTime' => $this->getPublishedTime()
]
);
}
+ $this->cleanArray($result);
+
return $result;
}