|
40 | 40 | }
|
41 | 41 |
|
42 | 42 | $storyMethods = [];
|
43 |
| -/*foreach (['stories.StoryViewsList', 'stories.Stories', 'stories.PeerStories', 'stories.StoryReactionsList'] as $t) { |
| 43 | +//foreach (['stories.StoryViewsList', 'stories.Stories', 'stories.PeerStories', 'stories.StoryReactionsList'] as $t) { |
| 44 | +foreach (['stories.Stories'] as $t) { |
44 | 45 | foreach ($TL->getMethodsOfType($t) as $method => $_) {
|
45 | 46 | $storyMethods[$method] = true;
|
46 | 47 | $locations['storyItem'][] = new CallOp(
|
|
51 | 52 | ]
|
52 | 53 | );
|
53 | 54 | }
|
54 |
| -}*/ |
| 55 | +} |
| 56 | +/* |
55 | 57 | foreach (['stories.Stories'] as $t) {
|
56 | 58 | foreach ($TL->getMethodsOfType($t) as $method => $_) {
|
57 | 59 | $storyMethods[$method] = true;
|
|
67 | 69 | ]
|
68 | 70 | );
|
69 | 71 | }
|
70 |
| -} |
| 72 | +}*/ |
71 | 73 |
|
72 | 74 | $locations['storyViewPublicRepost'][] = new CallOp(
|
73 | 75 | 'stories.getStoriesByID',
|
|
84 | 86 | ]
|
85 | 87 | );
|
86 | 88 |
|
87 |
| -$locations['peerStories'][] = new CallOp( |
| 89 | +/*$locations['peerStories'][] = new CallOp( |
88 | 90 | 'stories.getStoriesByID',
|
89 | 91 | [
|
90 | 92 | 'id' => new ArrayOp(new CopyOp([['peerStories', 'stories', CopyOp::FLAG_UNPACK_ARRAY], ['storyItem', 'id']])),
|
91 | 93 | 'peer' => new GetInputPeerOp(new CopyOp([['peerStories', 'peer']])),
|
92 | 94 | ]
|
| 95 | +);*/ |
| 96 | + |
| 97 | +$locations['storyItem'][] = new CallOp( |
| 98 | + 'stories.getStoriesByID', |
| 99 | + [ |
| 100 | + 'id' => new ArrayOp(new CopyOp([['storyItem', 'id']])), |
| 101 | + 'peer' => new GetInputPeerOp(new ExtractFromParentOp([['peerStories', 'peer']])), |
| 102 | + ] |
93 | 103 | );
|
94 | 104 |
|
95 | 105 | foreach (['foundStory', 'publicForwardStory', 'webPageAttributeStory', 'messageMediaStory'] as $c) {
|
|
123 | 133 | 'peer' => new GetInputPeerOp(new CopyOp([['storyItem', 'from_id', CopyOp::FLAG_IF_ABSENT_ABORT]])),
|
124 | 134 | ]);
|
125 | 135 | $locations['messages.getSponsoredMessages'][] = new CopyMethodCallOp('messages.getSponsoredMessages');
|
126 |
| -/*$locations['channelAdminLogEvent'][] = new CallOp( |
| 136 | +$locations['channelAdminLogEvent'][] = new CallOp( |
127 | 137 | 'channels.getAdminLog',
|
128 | 138 | [
|
129 | 139 | 'channel' => new GetInputChannelOp(new ExtractFromParentOp([['channels.getAdminLog', 'channel']])),
|
|
132 | 142 | 'limit' => new PrimitiveLiteralOp('int', 1),
|
133 | 143 | 'q' => new PrimitiveLiteralOp('string', ''),
|
134 | 144 | ]
|
135 |
| -);*/ |
| 145 | +); |
136 | 146 |
|
| 147 | +/* |
137 | 148 | $locations['channels.getAdminLog'][] = new CallOp(
|
138 | 149 | 'channels.getAdminLog',
|
139 | 150 | [
|
|
151 | 162 | 'limit' => new PrimitiveLiteralOp('int', 1),
|
152 | 163 | 'q' => new PrimitiveLiteralOp('string', ''),
|
153 | 164 | ]
|
154 |
| -); |
| 165 | +);*/ |
155 | 166 |
|
156 | 167 | $locations['bots.getPreviewMedias'][] = new CopyMethodCallOp('bots.getPreviewMedias');
|
157 | 168 | $locations['bots.getPreviewInfo'][] = new CopyMethodCallOp('bots.getPreviewInfo');
|
|
194 | 205 | $starMethods = [];
|
195 | 206 | foreach ($TL->getMethodsOfType('payments.StarsStatus') as $method => $_) {
|
196 | 207 | $starMethods[$method] = true;
|
197 |
| - /*$locations['starsTransaction'][] = new CallOp( |
| 208 | + $locations['starsTransaction'][] = new CallOp( |
198 | 209 | 'payments.getStarsTransactionsByID',
|
199 | 210 | [
|
200 | 211 | 'peer' => new ExtractFromParentOp([[$method, 'peer']]),
|
|
207 | 218 | ]
|
208 | 219 | )),
|
209 | 220 | ]
|
210 |
| - );*/ |
| 221 | + );/* |
211 | 222 | $locations[$method][] = new CallOp(
|
212 | 223 | 'payments.getStarsTransactionsByID',
|
213 | 224 | [
|
|
229 | 240 | ]
|
230 | 241 | )),
|
231 | 242 | ]
|
232 |
| - ); |
| 243 | + );*/ |
233 | 244 | }
|
234 | 245 | $locations['attachMenuBot'][] = new CallOp(
|
235 | 246 | 'messages.getAttachMenuBot',
|
|
307 | 318 | ['hash' => new PrimitiveLiteralOp('int', 0)],
|
308 | 319 | );
|
309 | 320 |
|
310 |
| -/*$locations['photo'][] = new CallOp( |
| 321 | +$locations['photo'][] = new CallOp( |
311 | 322 | 'photos.getUserPhotos',
|
312 | 323 | [
|
313 | 324 | 'user_id' => new ExtractFromParentOp([['photos.getUserPhotos', 'user_id']]),
|
314 | 325 | 'offset' => new PrimitiveLiteralOp('int', -1),
|
315 | 326 | 'max_id' => new CopyOp([['photo', 'id']]),
|
316 | 327 | 'limit' => new PrimitiveLiteralOp('int', 1),
|
317 | 328 | ]
|
318 |
| -);*/ |
319 |
| - |
| 329 | +); |
| 330 | +/* |
320 | 331 | $locations['photos.getUserPhotos'][] = new CallOp(
|
321 | 332 | 'photos.getUserPhotos',
|
322 | 333 | [
|
|
329 | 340 | ]),
|
330 | 341 | 'limit' => new PrimitiveLiteralOp('int', 1),
|
331 | 342 | ]
|
332 |
| -); |
| 343 | +);*/ |
333 | 344 |
|
334 | 345 | foreach (['photos.updateProfilePhoto', 'photos.uploadProfilePhoto'] as $method) {
|
335 | 346 | $locations[$method][] = new CallOp(
|
|
445 | 456 |
|
446 | 457 | $validated = [];
|
447 | 458 |
|
448 |
| -$tmp = new Ast(allowBackrefs: false); |
| 459 | +$tmp = new Ast(allowBackrefs: true, allowUnpacking: true); |
449 | 460 | foreach (['Document' => 'document', 'Photo' => 'photo'] as $type => $constructor) {
|
450 | 461 | $stack = [[$constructor, 'file_reference']];
|
451 | 462 | $stackTypes = [$type => 1];
|
@@ -533,7 +544,7 @@ static function (array $stack) use ($locations, $TL, $tmp, &$validated, $storyMe
|
533 | 544 | throw new AssertionError("Leftover ops!");
|
534 | 545 | }
|
535 | 546 |
|
536 |
| -$output = new Ast(allowBackrefs: false); |
| 547 | +$output = new Ast(allowBackrefs: true, allowUnpacking: false); |
537 | 548 | foreach ($locations as $constructor => $ops) {
|
538 | 549 | foreach ($ops as $idx => $op) {
|
539 | 550 | $op->build(new TLContext($TL, $output, $constructor, $TL->isConstructor($constructor)));
|
|
0 commit comments