Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/1690/head
Maxence Lange 2023-03-21 10:25:11 -01:00
rodzic 3f3edc4fd6
commit bcb91ac143
3 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -630,7 +630,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable {
"content" => $this->getContent(), "content" => $this->getContent(),
"sensitive" => $this->isSensitive(), "sensitive" => $this->isSensitive(),
"spoiler_text" => $this->getSpoilerText(), "spoiler_text" => $this->getSpoilerText(),
'visibility' => ($this->getVisibility() === '') ? 'unknown' : $this->getVisibility(), 'visibility' => $this->getVisibility(),
"language" => $this->getLanguage(), "language" => $this->getLanguage(),
"in_reply_to_id" => null, "in_reply_to_id" => null,
"in_reply_to_account_id" => null, "in_reply_to_account_id" => null,

Wyświetl plik

@ -139,7 +139,10 @@ class ActionService {
} }
private function reblog(Person $actor, string $postId, bool $enabled = true): void { private function reblog(Person $actor, string $postId, bool $enabled = true): void {
if ($enabled) {
$this->boostService->create($actor, $postId); $this->boostService->create($actor, $postId);
//$this->streamActionService->setActionBool($actor->getId(), $postId, StreamAction::BOOSTED, $enabled); } else {
$this->boostService->delete($actor, $postId);
}
} }
} }

Wyświetl plik

@ -105,7 +105,7 @@ class BoostService {
* @throws SocialAppConfigException * @throws SocialAppConfigException
* @throws Exception * @throws Exception
*/ */
public function create(Person $actor, string $postId, &$token = ''): ACore { public function create(Person $actor, string $postId, string &$token = ''): ACore {
/** @var Announce $announce */ /** @var Announce $announce */
$announce = AP::$activityPub->getItemFromType(Announce::TYPE); $announce = AP::$activityPub->getItemFromType(Announce::TYPE);
$this->streamService->assignItem($announce, $actor, Stream::TYPE_ANNOUNCE); $this->streamService->assignItem($announce, $actor, Stream::TYPE_ANNOUNCE);
@ -169,7 +169,7 @@ class BoostService {
* @throws SocialAppConfigException * @throws SocialAppConfigException
* @throws StreamNotFoundException * @throws StreamNotFoundException
*/ */
public function delete(Person $actor, string $postId, &$token = ''): ACore { public function delete(Person $actor, string $postId, string &$token = ''): ACore {
$undo = new Undo(); $undo = new Undo();
$this->streamService->assignItem($undo, $actor, Stream::TYPE_PUBLIC); $this->streamService->assignItem($undo, $actor, Stream::TYPE_PUBLIC);
$undo->setActor($actor); $undo->setActor($actor);
@ -188,7 +188,7 @@ class BoostService {
$interface = AP::$activityPub->getInterfaceFromType(Announce::TYPE); $interface = AP::$activityPub->getInterfaceFromType(Announce::TYPE);
$interface->delete($announce); $interface->delete($announce);
// $this->streamRequest->deleteStreamById($announce->getId(), Announce::TYPE); $this->streamRequest->deleteById($announce->getId(), Announce::TYPE);
$this->signatureService->signObject($actor, $undo); $this->signatureService->signObject($actor, $undo);
$token = $this->activityService->request($undo); $token = $this->activityService->request($undo);