Fixes I guess

This commit is contained in:
Daniil Gentili 2017-08-01 11:59:07 +02:00
parent e4a3fc9484
commit 5cc6719c3d

View File

@ -301,6 +301,7 @@ trait Files
}
if ($res['_'] === 'upload.fileCdnRedirect') {
$cdn = true;
$this->get_config([], ['datacenter' => $this->datacenter->curdc]);
$message_media['file_token'] = $res['file_token'];
$message_media['cdn_key'] = $res['encryption_key'];
$message_media['cdn_iv'] = $res['encryption_iv'];
@ -311,6 +312,7 @@ trait Files
}
if ($res['_'] === 'upload.cdnFileReuploadNeeded') {
\danog\MadelineProto\Logger::log(['File is not stored on CDN, requesting reupload!'], \danog\MadelineProto\Logger::NOTICE);
$this->get_config([], ['datacenter' => $this->datacenter->curdc]);
try {
$this->add_cdn_hashes($message_media['file_token'], $this->method_call('upload.reuploadCdnFile', ['file_token' => $message_media['file_token'], 'request_token' => $res['request_token']], ['heavy' => true, 'datacenter' => $old_dc]));
} catch (\danog\MadelineProto\RPCErrorException $e) {