mirror of
https://github.com/friendica/friendica
synced 2025-04-26 03:10:13 +00:00
API: several fixes to the Twitter/Statusnet API
This commit is contained in:
parent
093dd70e79
commit
bf5c8a2c43
22 changed files with 94 additions and 70 deletions
|
@ -50,8 +50,8 @@ class Retweet extends BaseApi
|
|||
throw new BadRequestException('An id is missing.');
|
||||
}
|
||||
|
||||
$fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
||||
$item = Post::selectFirst($fields, ['id' => $id, 'private' => [Item::PUBLIC, Item::UNLISTED]]);
|
||||
$fields = ['id', 'uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
||||
$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 (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::TWITTER])) {
|
||||
|
@ -59,7 +59,7 @@ class Retweet extends BaseApi
|
|||
throw new InternalServerErrorException();
|
||||
}
|
||||
|
||||
$item_id = $id;
|
||||
$item_id = $item['id'];
|
||||
} else {
|
||||
$item_id = Diaspora::performReshare($item['uri-id'], $uid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue