White spaces

This commit is contained in:
Michael 2022-01-16 20:17:31 +00:00
parent 0e15715088
commit dc48f9b8f0
6 changed files with 19 additions and 18 deletions

View file

@ -37,36 +37,36 @@ class UpdateProfileImage extends BaseApi
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
// get mediadata from image or media (Twitter call api/account/update_profile_image provides image)
if (!empty($_FILES['image'])) {
$media = $_FILES['image'];
} elseif (!empty($_FILES['media'])) {
$media = $_FILES['media'];
}
// error if image data is missing
if (empty($media)) {
throw new HTTPException\BadRequestException('no media data submitted');
}
// save new profile image
$resource_id = Photo::uploadAvatar($uid, $media);
if (empty($resource_id)) {
throw new HTTPException\InternalServerErrorException('image upload failed');
}
// output for client
$skip_status = $this->getRequestValue($request, 'skip_status', false);
$user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray();
// "verified" isn't used here in the standard
unset($user_info['verified']);
// "uid" is only needed for some internal stuff, so remove it from here
unset($user_info['uid']);
$this->response->exit('user', ['user' => $user_info], $this->parameters['extension'] ?? null);
}
}

View file

@ -49,7 +49,7 @@ class Tweets extends BaseApi
$data['status'] = [];
$count = $this->getRequestValue($request, 'count', 15);
$count = $this->getRequestValue($request, 'count', 20, 1, 100);
$count = $this->getRequestValue($request, 'rpp', $count);
$since_id = $this->getRequestValue($request, 'since_id', 0, 0);
$max_id = $this->getRequestValue($request, 'max_id', 0, 0);