1
0
Fork 0

API: several fixes to the Twitter/Statusnet API

This commit is contained in:
Michael 2022-02-25 19:16:40 +00:00
commit bf5c8a2c43
22 changed files with 94 additions and 70 deletions

View file

@ -70,7 +70,7 @@ class Status extends BaseFactory
* @param int $uriId Uri-ID of the item
* @param int $uid Item user
*
* @return \Friendica\Object\Api\Mastodon\Status
* @return \Friendica\Object\Api\Twitter\Status
* @throws HTTPException\InternalServerErrorException
* @throws ImagickException|HTTPException\NotFoundException
*/
@ -89,13 +89,13 @@ class Status extends BaseFactory
* @param int $uriId Uri-ID of the item
* @param int $uid Item user
*
* @return \Friendica\Object\Api\Mastodon\Status
* @return \Friendica\Object\Api\Twitter\Status
* @throws HTTPException\InternalServerErrorException
* @throws ImagickException|HTTPException\NotFoundException
*/
public function createFromUriId(int $uriId, $uid = 0, $include_entities = false): \Friendica\Object\Api\Twitter\Status
{
$fields = ['id', 'parent', 'uri-id', 'uid', 'author-id', 'author-link', 'author-network', 'owner-id', 'starred', 'app', 'title', 'body', 'raw-body', 'created', 'network',
$fields = ['parent-uri-id', 'uri-id', 'uid', 'author-id', 'author-link', 'author-network', 'owner-id', 'starred', 'app', 'title', 'body', 'raw-body', 'created', 'network',
'thr-parent-id', 'parent-author-id', 'parent-author-nick', 'language', 'uri', 'plink', 'private', 'vid', 'gravity', 'coord'];
$item = Post::selectFirst($fields, ['uri-id' => $uriId, 'uid' => [0, $uid]], ['order' => ['uid' => true]]);
if (!$item) {
@ -108,7 +108,7 @@ class Status extends BaseFactory
* @param array $item item array
* @param int $uid Item user
*
* @return \Friendica\Object\Api\Mastodon\Status
* @return \Friendica\Object\Api\Twitter\Status
* @throws HTTPException\InternalServerErrorException
* @throws ImagickException|HTTPException\NotFoundException
*/