This commit is contained in:
Daniil Gentili 2017-02-22 21:43:51 +01:00
parent f63fd6fecf
commit 98e917525f
3 changed files with 5 additions and 5 deletions

View File

@ -316,7 +316,7 @@ trait PeerHandler
$res['bot_info'] = $full['full']['bot_info'];
}
if (isset($full['full']['profile_photo']['sizes'])) {
$res['photo'] = $this->photosize_to_botapi(end($full['full']['profile_photo']['sizes']), $full['User']);
$res['photo'] = $this->photosize_to_botapi(end($full['full']['profile_photo']['sizes']), []);
}
$bio = '';
if ($full['type'] === 'user' && isset($res['username']) && !isset($res['about']) && $fullfetch) {
@ -338,7 +338,7 @@ trait PeerHandler
}
if (isset($full['full']['chat_photo']['sizes'])) {
$res['photo'] = $this->photosize_to_botapi(end($full['full']['chat_photo']['sizes']), $full['Chat']);
$res['photo'] = $this->photosize_to_botapi(end($full['full']['chat_photo']['sizes']), []);
}
if (isset($full['full']['exported_invite']['link'])) {
$res['invite'] = $full['full']['exported_invite']['link'];
@ -361,7 +361,7 @@ trait PeerHandler
}
if (isset($full['full']['chat_photo']['sizes'])) {
$res['photo'] = $this->photosize_to_botapi(end($full['full']['chat_photo']['sizes']), $full['Chat']);
$res['photo'] = $this->photosize_to_botapi(end($full['full']['chat_photo']['sizes']), []);
}
if (isset($full['full']['exported_invite']['link'])) {
$res['invite'] = $full['full']['exported_invite']['link'];

View File

@ -105,7 +105,7 @@ trait Files
public function photosize_to_botapi($photo, $message_media, $thumbnail = false)
{
$ext = $this->get_extension_from_location(['_' => 'inputFileLocation', 'volume_id' => $photo['location']['volume_id'], 'local_id' => $photo['location']['local_id'], 'secret' => $photo['location']['secret'], 'dc_id' => $photo['location']['dc_id']], '.jpg');
$data = \danog\PHP\Struct::pack('<iiqqqqib', $thumbnail ? 0 : 2, $photo['location']['dc_id'], $thumbnail ? 0 : $message_media['id'], $thumbnail ? 0 : $message_media['access_hash'], $photo['location']['volume_id'], $photo['location']['secret'], $photo['location']['local_id'], 2);
$data = \danog\PHP\Struct::pack('<iiqqqqib', $thumbnail ? 0 : 2, $photo['location']['dc_id'], isset($message_media['id']) ? $message_media['id'] : 0, isset($message_media['access_hash'] ? $message_media['access_hash'] : 0, $photo['location']['volume_id'], $photo['location']['secret'], $photo['location']['local_id'], 2);
return [
'file_id' => $this->base64url_encode($this->rle_encode($data)),

View File

@ -460,7 +460,7 @@ trait TL
$type_name = 'document';
$res = [];
if ($data['document']['thumb']['_'] === 'photoSize') {
$res['thumb'] = $this->photosize_to_botapi($data['document']['thumb'], $data['document'], true);
$res['thumb'] = $this->photosize_to_botapi($data['document']['thumb'], [], true);
}
foreach ($data['document']['attributes'] as $attribute) {
switch ($attribute['_']) {