Update to layer v112 (#804)

* Update to layer v112
TL file taken from tdlib

* Added TL file
This commit is contained in:
giuseppeM99 2020-04-24 11:16:10 +02:00 committed by GitHub
parent 979d7575fc
commit 234065987a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1504 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class MTProto extends AsyncConstruct implements TLCallback
*
* @var int
*/
const V = 137;
const V = 138;
/**
* String release version.
*
@ -1186,12 +1186,12 @@ class MTProto extends AsyncConstruct implements TLCallback
'lang_pack' => $lang_pack,
], 'tl_schema' => [
// TL scheme files
'layer' => 111,
'layer' => 112,
// layer version
'src' => [
'mtproto' => __DIR__.'/TL_mtproto_v1.tl',
// mtproto TL scheme
'telegram' => __DIR__.'/TL_telegram_v111.tl',
'telegram' => __DIR__.'/TL_telegram_v112.tl',
// telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl',
// secret chats TL scheme

View File

@ -501,6 +501,7 @@ trait Files
list($res) = yield \danog\MadelineProto\Tools::all([$read, $write]);
return $res;
}
private function genAllFile($media): \Generator
{
$res = [$this->TL->getConstructors()->findByPredicate($media['_'])['type'] => $media];
@ -508,11 +509,25 @@ trait Files
case 'messageMediaPoll':
$res['Poll'] = $media['poll'];
$res['InputMedia'] = ['_' => 'inputMediaPoll', 'poll' => $res['Poll']];
if ($res['Poll']['quiz']) {
foreach ($media['results']['results'] as $answer) {
if ($answer['correct']) {
$res['InputMedia']['correct_answers'][] = $answer['option'];
}
}
}
break;
case 'updateMessagePoll':
$res['Poll'] = $media['poll'];
$res['InputMedia'] = ['_' => 'inputMediaPoll', 'poll' => $res['Poll']];
$res['MessageMedia'] = ['_' => 'messageMediaPoll', 'poll' => $res['Poll'], 'results' => $media['results']];
if ($res['Poll']['quiz']) {
foreach ($media['results']['results'] as $answer) {
if ($answer['correct']) {
$res['InputMedia']['correct_answers'][] = $answer['option'];
}
}
}
break;
case 'messageMediaPhoto':
if (!isset($media['photo']['access_hash'])) {
@ -537,7 +552,7 @@ trait Files
}
break;
case 'messageMediaDice':
$res['InputMedia'] = ['_' => 'inputMediaDice'];
$res['InputMedia'] = ['_' => 'inputMediaDice', 'emoticon' => $media['emoticon']];
break;
case 'poll':
$res['InputMedia'] = ['_' => 'inputMediaPoll', 'poll' => $res['Poll']];

File diff suppressed because it is too large Load Diff