|
37 | 37 |
|
38 | 38 | $TL = new TLWrapper($TL); |
39 | 39 | $locations = []; |
40 | | - |
41 | 40 | Logger::log("Generating file reference map..."); |
42 | 41 |
|
43 | 42 | foreach ($TL->getConstructorsOfType('Message') as $constructor => $_) { |
|
196 | 195 |
|
197 | 196 | foreach (['stories.createAlbum', 'stories.getAlbums', 'stories.updateAlbum'] as $m) { |
198 | 197 | $locations[$m][] = new CallOp('stories.getAlbums', [ |
199 | | - 'peer' => new CopyOp([[$m, 'peer']]), |
| 198 | + 'peer' => new GetInputPeerOp(new Path([[$m, 'peer']])), |
200 | 199 | 'hash' => new PrimitiveLiteralOp('long', 0), |
201 | 200 | ], 'fileSourceStoryAlbum'); |
202 | 201 | } |
203 | 202 |
|
204 | 203 | $locations['bots.getPreviewMedias'][] = new CopyMethodCallOp('bots.getPreviewMedias', 'fileSourceBotPreviewMedia'); |
205 | 204 | $locations['bots.getPreviewInfo'][] = new CopyMethodCallOp('bots.getPreviewInfo', 'fileSourceBotPreviewInfo'); |
206 | 205 | $locations['bots.addPreviewMedia'][] = new CallOp('bots.getPreviewInfo', [ |
207 | | - 'bot' => new CopyOp([['bots.addPreviewMedia', 'bot']]), |
| 206 | + 'bot' => new GetInputUserOp(new Path([['bots.addPreviewMedia', 'bot']])), |
208 | 207 | 'lang_code' => new CopyOp([['bots.addPreviewMedia', 'lang_code']]), |
209 | 208 | ], 'fileSourceBotPreviewInfo'); |
210 | 209 | $locations['bots.editPreviewMedia'][] = new CallOp('bots.getPreviewInfo', [ |
211 | | - 'bot' => new CopyOp([['bots.editPreviewMedia', 'bot']]), |
| 210 | + 'bot' => new GetInputUserOp(new Path([['bots.editPreviewMedia', 'bot']])), |
212 | 211 | 'lang_code' => new CopyOp([['bots.editPreviewMedia', 'lang_code']]), |
213 | 212 | ], 'fileSourceBotPreviewInfo'); |
214 | 213 |
|
|
249 | 248 | $locations['starsTransaction'][] = new CallOp( |
250 | 249 | 'payments.getStarsTransactionsByID', |
251 | 250 | [ |
252 | | - 'peer' => new CopyOp(new Path([[$method, 'peer']], true)), |
| 251 | + 'peer' => new GetInputPeerOp(new Path([[$method, 'peer']], true)), |
253 | 252 | ...($method === 'payments.getStarsSubscriptions' ? [] : ['ton' => new CopyOp(new Path([[$method, 'ton', Path::FLAG_PASSTHROUGH]], true))]), |
254 | 253 | 'id' => new ArrayOp(new ConstructorOp( |
255 | 254 | 'inputStarsTransaction', |
|
358 | 357 | $locations['photo'][] = new CallOp( |
359 | 358 | 'photos.getUserPhotos', |
360 | 359 | [ |
361 | | - 'user_id' => new CopyOp(new Path([['photos.getUserPhotos', 'user_id']], true)), |
| 360 | + 'user_id' => new GetInputUserOp(new Path([['photos.getUserPhotos', 'user_id']], true)), |
362 | 361 | 'offset' => new PrimitiveLiteralOp('int', -1), |
363 | 362 | 'max_id' => new CopyOp([['photo', 'id']]), |
364 | 363 | 'limit' => new PrimitiveLiteralOp('int', 1), |
|
384 | 383 | $locations[$method][] = new CallOp( |
385 | 384 | 'photos.getUserPhotos', |
386 | 385 | [ |
387 | | - 'user_id' => new CopyOp( |
| 386 | + 'user_id' => new GetInputUserOp(new Path( |
388 | 387 | [[ |
389 | 388 | $method, |
390 | 389 | 'bot', |
|
393 | 392 | [] |
394 | 393 | ), |
395 | 394 | ]] |
396 | | - ), |
| 395 | + )), |
397 | 396 | 'offset' => new PrimitiveLiteralOp('int', -1), |
398 | 397 | 'max_id' => new CopyOp([[$method, ''], ['photos.photo', 'photo'], ['photo', 'id']]), |
399 | 398 | 'limit' => new PrimitiveLiteralOp('int', 1), |
|
404 | 403 | $locations['photos.uploadContactProfilePhoto'][] = new CallOp( |
405 | 404 | 'photos.getUserPhotos', |
406 | 405 | [ |
407 | | - 'user_id' => new CopyOp( |
408 | | - [['photos.uploadContactProfilePhoto', 'user_id']], |
| 406 | + 'user_id' => new GetInputUserOp( |
| 407 | + new Path([['photos.uploadContactProfilePhoto', 'user_id']]), |
409 | 408 | ), |
410 | 409 | 'offset' => new PrimitiveLiteralOp('int', -1), |
411 | 410 | 'max_id' => new CopyOp([['photos.uploadContactProfilePhoto', ''], ['photos.photo', 'photo'], ['photo', 'id']]), |
|
495 | 494 | unset($stack[$pos]); |
496 | 495 | }; |
497 | 496 |
|
498 | | - |
499 | 497 | $pre = [ |
500 | 498 | 'fileSourceMessage' => [ |
501 | 499 | 'flags' => '#', |
502 | 500 | 'from_scheduled' => 'flags.0?true', |
503 | 501 | 'peer' => 'long', |
504 | | - 'id' => 'int' |
| 502 | + 'id' => 'int', |
505 | 503 | ], |
506 | 504 | 'fileSourceStarsTransaction' => [ |
507 | 505 | 'flags' => '#', |
508 | | - 'peer' => 'InputPeer', |
| 506 | + 'peer' => 'long', |
509 | 507 | 'id' => 'string', |
510 | 508 | 'refund' => 'flags.0?true', |
511 | 509 | 'ton' => 'flags.1?true', |
512 | | - ] |
| 510 | + ], |
513 | 511 | ]; |
514 | 512 |
|
515 | 513 | $validated = []; |
|
0 commit comments