Skip to content

Commit 9349915

Browse files
committed
Cleanup
1 parent 8d14796 commit 9349915

5 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/TL_file_ref_map_schema.tl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ paramIsFlagAbortIfEmpty#f8fe9fee = ParamFlag;
2222
paramIsFlagFallback#202b77a1 fallback:TypedOp = ParamFlag;
2323
paramIsFlagPassthrough#1dc6e17d = ParamFlag;
2424

25-
pathPart#7b8b07d4 flags:# constructor:string param:string flag:ParamFlag = PathPart;
25+
pathPart#8dc6ff46 constructor:string param:string flag:ParamFlag = PathPart;
2626

2727
path#0c3586a2 parts:Vector<PathPart> = Path;
2828
pathParent#58f13684 parts:Vector<PathPart> = Path;
@@ -44,7 +44,7 @@ extractUserIdFromInputUserAndStore#7720aa2e from:Path to:string = FieldExtractor
4444

4545
// Actions
4646
callOp#c2ff3383 method:string args:Vector<TypedOpArg> = ActionOp;
47-
getMessageOp#84b69f70 flags:# peer:TypedOp id:TypedOp from_scheduled:flags.0?TypedOp = ActionOp;
47+
getMessageOp#b51d9468 peer:TypedOp id:TypedOp from_scheduled:TypedOp = ActionOp;
4848

4949
// For string => TypedOp dictionaries
5050
typedOpArg#3a2930c2 key:string value:TypedOp = TypedOpArg;

src/file_ref_map.dat

-392 Bytes
Binary file not shown.

tools/FileRefExtractor/Path.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,16 @@ public function buildPath(TLContext $tl, string $extractor): string
9797
];
9898
if (isset($part[2])) {
9999
if ($part[2] instanceof TypedOp) {
100-
$newPart['flag'] = ['_' => 'paramIsFlagFallback', 'fallback' => $part[2]->build($tl)];
100+
$fallback = $part[2]->build($tl);
101+
array_walk_recursive($fallback, static function ($v): void {
102+
if (\is_array($v)
103+
&& isset($v['_'])
104+
&& \in_array($v['_'], ['copyOp', 'getInputChannelByIdOp', 'getInputUserByIdOp', 'getInputPeerByIdOp'], true)
105+
) {
106+
throw new \InvalidArgumentException("Cannot use {$v['_']} as fallback in TypedOp");
107+
}
108+
});
109+
$newPart['flag'] = ['_' => 'paramIsFlagFallback', 'fallback' => $fallback];
101110
} elseif (\is_int($part[2])) {
102111
if ($part[2] & self::FLAG_UNPACK_ARRAY) {
103112
if ($tl->buildMode instanceof Ast && !$tl->buildMode->allowUnpacking) {

tools/gen_filerefmap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function generate(int $layer, string $schema): void
8282
}
8383
ksort($res);
8484

85-
$start = min(213, array_key_first($res));
85+
$start = min(214, array_key_first($res));
8686
$end = max(array_key_last($res), $last);
8787

8888
for ($layer = $start; $layer <= $end; $layer++) {

0 commit comments

Comments
 (0)