Only search for empty quoted reshares (Diaspora type)
This commit is contained in:
parent
ca8a89ed1c
commit
f013c92487
4 changed files with 6 additions and 4 deletions
|
@ -1020,7 +1020,7 @@ class Conversation
|
||||||
|
|
||||||
DBA::close($thread_items);
|
DBA::close($thread_items);
|
||||||
|
|
||||||
$quotes = Post::select(array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), ['quote-uri-id' => array_column($quoteuriids, 'uri-id'), 'uid' => 0]);
|
$quotes = Post::select(array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), ['quote-uri-id' => array_column($quoteuriids, 'uri-id'), 'body' => '', 'uid' => 0]);
|
||||||
while ($quote = Post::fetch($quotes)) {
|
while ($quote = Post::fetch($quotes)) {
|
||||||
$row = $quote;
|
$row = $quote;
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,8 @@ class Status extends BaseFactory
|
||||||
'deleted' => false
|
'deleted' => false
|
||||||
]) + Post::countPosts([
|
]) + Post::countPosts([
|
||||||
'quote-uri-id' => $uriId,
|
'quote-uri-id' => $uriId,
|
||||||
'deleted' => false
|
'body' => '',
|
||||||
|
'deleted' => false
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$count_like = Post::countPosts([
|
$count_like = Post::countPosts([
|
||||||
|
@ -152,6 +153,7 @@ class Status extends BaseFactory
|
||||||
'quote-uri-id' => $uriId,
|
'quote-uri-id' => $uriId,
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'origin' => true,
|
'origin' => true,
|
||||||
|
'body' => '',
|
||||||
'deleted' => false
|
'deleted' => false
|
||||||
]);
|
]);
|
||||||
$userAttributes = new \Friendica\Object\Api\Mastodon\Status\UserAttributes(
|
$userAttributes = new \Friendica\Object\Api\Mastodon\Status\UserAttributes(
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Unreblog extends BaseApi
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['network'] == Protocol::DIASPORA) {
|
if ($item['network'] == Protocol::DIASPORA) {
|
||||||
$item = Post::selectFirstForUser($uid, ['id'], ['quote-uri-id' => $this->parameters['id'], 'origin' => true, 'uid' => $uid]);
|
$item = Post::selectFirstForUser($uid, ['id'], ['quote-uri-id' => $this->parameters['id'], 'body' => '', 'origin' => true, 'uid' => $uid]);
|
||||||
if (empty($item['id'])) {
|
if (empty($item['id'])) {
|
||||||
DI::mstdnError()->RecordNotFound();
|
DI::mstdnError()->RecordNotFound();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Activity extends BaseModule
|
||||||
if (in_array($verb, ['announce', 'unannounce'])) {
|
if (in_array($verb, ['announce', 'unannounce'])) {
|
||||||
$item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [DI::userSession()->getLocalUserId(), 0]]);
|
$item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [DI::userSession()->getLocalUserId(), 0]]);
|
||||||
if ($item['network'] == Protocol::DIASPORA) {
|
if ($item['network'] == Protocol::DIASPORA) {
|
||||||
$quote = Post::selectFirst(['id'], ['quote-uri-id' => $item['uri-id'], 'origin' => true, 'uid' => 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 (!empty($quote['id'])) {
|
||||||
if (!Item::markForDeletionById($quote['id'])) {
|
if (!Item::markForDeletionById($quote['id'])) {
|
||||||
throw new HTTPException\BadRequestException();
|
throw new HTTPException\BadRequestException();
|
||||||
|
|
Loading…
Reference in a new issue