diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-03-08 15:51:17 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2023-03-08 15:51:17 -0100 |
commit | 17e383471e4a486e94e90b0b537464e06b890b64 (patch) | |
tree | eaf5ca3929719785ef63dfa86d11740a7343b235 | |
parent | fb3e07a8632673a14009978033124c0de34414dc (diff) |
notification.status format
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | lib/Controller/ApiController.php | 3 | ||||
-rw-r--r-- | lib/Model/ActivityPub/Stream.php | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 70d94ee6..b0ae3a0b 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -420,8 +420,7 @@ class ApiController extends Controller { ProbeOptions::ACCOUNT, ProbeOptions::PUBLIC, ProbeOptions::DIRECT, - ProbeOptions::FAVOURITES, - ProbeOptions::NOTIFICATIONS + ProbeOptions::FAVOURITES ] )) { throw new UnknownProbeException('unknown timeline'); diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php index b540cd42..29ce3973 100644 --- a/lib/Model/ActivityPub/Stream.php +++ b/lib/Model/ActivityPub/Stream.php @@ -604,11 +604,20 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { $type = ''; } + $status = null; + if ($statusPost = $this->getDetails('post')) { + if (!empty($statusPost)) { + $status = new Stream(); + $status->importFromCache($statusPost); + $status->setExportFormat(self::FORMAT_LOCAL); + } + } + $result = [ 'id' => $this->getId(), 'type' => $type, 'created_at' => $this->getOriginCreationTime(), - 'status' => $this->getDetails('post'), + 'status' => $status, ]; if ($this->hasActor()) { |