Merge pull request #1690 from nextcloud/fix/noid/unreblog

fix unreblog
pull/1691/head
Maxence Lange 2023-03-21 10:29:54 -01:00 zatwierdzone przez GitHub
commit dc55d5ef12
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
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(),
"sensitive" => $this->isSensitive(),
"spoiler_text" => $this->getSpoilerText(),
'visibility' => ($this->getVisibility() === '') ? 'unknown' : $this->getVisibility(),
'visibility' => $this->getVisibility(),
"language" => $this->getLanguage(),
"in_reply_to_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 {
$this->boostService->create($actor, $postId);
//$this->streamActionService->setActionBool($actor->getId(), $postId, StreamAction::BOOSTED, $enabled);
if ($enabled) {
$this->boostService->create($actor, $postId);
} else {
$this->boostService->delete($actor, $postId);
}
}
}

Wyświetl plik

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