X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FItem%2FActivity.php;h=c9d192d249f07458ca66cfe613c0c5126231d0f4;hb=39a5bfc0c0ea3777b63adb57a7d6cb4b40a70e86;hp=3fa6d38fc90aceedb84b168efbc5d40ad261e3ed;hpb=eecc456e0cbef74665104b4cb46367bc4345f25b;p=friendica.git diff --git a/src/Module/Item/Activity.php b/src/Module/Item/Activity.php index 3fa6d38fc9..c9d192d249 100644 --- a/src/Module/Item/Activity.php +++ b/src/Module/Item/Activity.php @@ -1,6 +1,6 @@ parameters['verb']; - $itemId = $this->parameters['id']; + $verb = $this->parameters['verb']; + $itemId = $this->parameters['id']; + $handled = false; if (in_array($verb, ['announce', 'unannounce'])) { $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [DI::userSession()->getLocalUserId(), 0]]); if ($item['network'] == Protocol::DIASPORA) { - Diaspora::performReshare($item['uri-id'], DI::userSession()->getLocalUserId()); + $quote = Post::selectFirst(['id'], ['quote-uri-id' => $item['uri-id'], 'body' => '', 'origin' => true, 'uid' => DI::userSession()->getLocalUserId()]); + if (!empty($quote['id'])) { + if (!Item::markForDeletionById($quote['id'])) { + throw new HTTPException\BadRequestException(); + } + } else { + Diaspora::performReshare($item['uri-id'], DI::userSession()->getLocalUserId()); + } + $handled = true; } } - if (!Item::performActivity($itemId, $verb, DI::userSession()->getLocalUserId())) { + if (!$handled && !Item::performActivity($itemId, $verb, DI::userSession()->getLocalUserId())) { throw new HTTPException\BadRequestException(); }