Merge pull request #14136 from annando/issue-14134

Issue 14134: Allow reshare posts from Bluesky and Tumblr
pull/14138/head
Tobias Diekershoff 2024-05-10 08:04:33 +02:00 committed by GitHub
commit 0ae91b59ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ class Reblog extends BaseApi
if ($item['network'] == Protocol::DIASPORA) { if ($item['network'] == Protocol::DIASPORA) {
Diaspora::performReshare($this->parameters['id'], $uid); Diaspora::performReshare($this->parameters['id'], $uid);
} elseif (!in_array($item['network'], [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::TWITTER])) { } elseif (!in_array($item['network'], [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::BLUESKY, Protocol::TUMBLR, Protocol::TWITTER])) {
$this->logAndJsonError( $this->logAndJsonError(
422, 422,
$this->errorFactory->UnprocessableEntity($this->t("Posts from %s can't be shared", ContactSelector::networkToName($item['network']))) $this->errorFactory->UnprocessableEntity($this->t("Posts from %s can't be shared", ContactSelector::networkToName($item['network'])))

View File

@ -58,7 +58,7 @@ class Unreblog extends BaseApi
if (!Item::markForDeletionById($item['id'])) { if (!Item::markForDeletionById($item['id'])) {
$this->logAndJsonError(404, $this->errorFactory->RecordNotFound()); $this->logAndJsonError(404, $this->errorFactory->RecordNotFound());
} }
} elseif (!in_array($item['network'], [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::TWITTER])) { } elseif (!in_array($item['network'], [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::BLUESKY, Protocol::TUMBLR, Protocol::TWITTER])) {
$this->logAndJsonError( $this->logAndJsonError(
422, 422,
$this->errorFactory->UnprocessableEntity($this->t("Posts from %s can't be unshared", ContactSelector::networkToName($item['network']))) $this->errorFactory->UnprocessableEntity($this->t("Posts from %s can't be unshared", ContactSelector::networkToName($item['network'])))

View File

@ -54,7 +54,7 @@ class Retweet extends BaseApi
$item = Post::selectFirst($fields, ['uri-id' => $id, 'uid' => [0, $uid], 'private' => [Item::PUBLIC, Item::UNLISTED]], ['order' => ['uid' => true]]); $item = Post::selectFirst($fields, ['uri-id' => $id, 'uid' => [0, $uid], 'private' => [Item::PUBLIC, Item::UNLISTED]], ['order' => ['uid' => true]]);
if (DBA::isResult($item) && !empty($item['body'])) { if (DBA::isResult($item) && !empty($item['body'])) {
if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::TWITTER])) { if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::BLUESKY, Protocol::TUMBLR, Protocol::TWITTER])) {
if (!Item::performActivity($id, 'announce', $uid)) { if (!Item::performActivity($id, 'announce', $uid)) {
throw new InternalServerErrorException(); throw new InternalServerErrorException();
} }