Update to layer v112 (#804)
* Update to layer v112 TL file taken from tdlib * Added TL file
This commit is contained in:
parent
979d7575fc
commit
234065987a
@ -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
|
||||
|
@ -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']];
|
||||
|
1485
src/danog/MadelineProto/TL_telegram_v112.tl
Normal file
1485
src/danog/MadelineProto/TL_telegram_v112.tl
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user