fixing undefined object

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/374/head
Maxence Lange 2019-03-04 10:05:03 -01:00
rodzic d8824c1324
commit c41e798b84
1 zmienionych plików z 5 dodań i 3 usunięć
lib/Service

Wyświetl plik

@ -106,7 +106,9 @@ class PostService {
*/
public function createPost(Post $post, ACore &$activity = null): string {
$note = new Note();
$this->noteService->assignStream($note, $post->getActor(), $post->getType());
$actor = $post->getActor();
$this->noteService->assignStream($note, $actor, $post->getType());
$note->setAttributedTo(
$this->configService->getUrlSocial() . '@' . $actor->getPreferredUsername()
);
@ -117,8 +119,8 @@ class PostService {
$this->noteService->addRecipients($note, $post->getType(), $post->getTo());
$this->noteService->addHashtags($note, $post->getHashtags());
$result = $this->activityService->createActivity($post->getActor(), $note, $activity);
$this->accountService->cacheLocalActorDetailCount($post->getActor());
$result = $this->activityService->createActivity($actor, $note, $activity);
$this->accountService->cacheLocalActorDetailCount($actor);
return $result;
}