Issue 13041: API activities for reshared posts are now performed on the original posts

This commit is contained in:
Michael 2023-05-01 04:01:11 +00:00
parent f74cc59530
commit a5b00e9199
17 changed files with 107 additions and 30 deletions

View file

@ -44,12 +44,11 @@ class RebloggedBy extends BaseApi
DI::mstdnError()->UnprocessableEntity();
}
$id = $this->parameters['id'];
if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
if (!$post = Post::selectOriginal(['id'], ['uri-id' => $this->parameters['id'], 'uid' => [0, $uid]])) {
DI::mstdnError()->RecordNotFound();
}
$activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $id, 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => Activity::ANNOUNCE]);
$activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $post['id'], 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => Activity::ANNOUNCE]);
$accounts = [];