diff options
Diffstat (limited to 'Digitigrade/Model/Note.php')
| -rw-r--r-- | Digitigrade/Model/Note.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php index 4675546..6246795 100644 --- a/Digitigrade/Model/Note.php +++ b/Digitigrade/Model/Note.php @@ -101,6 +101,17 @@ class Note extends PushableModel implements TimelineIncludeable, Notifyable { $this->saveFormattedContents(); } + protected function finaliseAfterFetch(string $uri, ?\stdClass $data = null) { + // have to set up mentions here because it's not able to automatically map Actor[] ? + $this->mentions = []; + foreach (($data->mentions ?? []) as $actorUri) { + $actor = Actor::findByUri($actorUri); + if ($actor != null) { + $this->mentions[] = $actor; + } + } + } + protected function validate(): bool { // author has to be from the same instance as the note itself return hostname_from_uri($this->author->uri) == hostname_from_uri($this->uri); |
