|
35 | 35 | $locations[$constructor][] = new GetMessageOp( |
36 | 36 | new ExtractFromHereOp([[$constructor, 'peer_id']]), |
37 | 37 | new ExtractFromHereOp([[$constructor, 'id']]), |
38 | | - $constructor === 'message' ? new ExtractFromHereOp([[$constructor, 'from_scheduled', ExtractFromParentOp::FLAG_PASSTHROUGH]]) : null, |
| 38 | + $constructor === 'message' ? new ExtractFromHereOp([[$constructor, 'from_scheduled', ExtractFromHereOp::FLAG_PASSTHROUGH]]) : null, |
39 | 39 | ); |
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 | 44 | foreach ($TL->getMethodsOfType($t) as $method => $_) { |
45 | 45 | $storyMethods[$method] = true; |
46 | 46 | $locations['storyItem'][] = new CallOp( |
|
51 | 51 | ] |
52 | 52 | ); |
53 | 53 | } |
| 54 | +}*/ |
| 55 | +foreach (['stories.Stories'] as $t) { |
| 56 | + foreach ($TL->getMethodsOfType($t) as $method => $_) { |
| 57 | + $storyMethods[$method] = true; |
| 58 | + $locations[$method][] = new CallOp( |
| 59 | + 'stories.getStoriesByID', |
| 60 | + [ |
| 61 | + 'id' => new ArrayOp(new ExtractFromHereOp([ |
| 62 | + [$method, ''], |
| 63 | + ['stories.stories', 'stories', ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 64 | + ['storyItem', 'id'] |
| 65 | + ])), |
| 66 | + 'peer' => new GetInputPeerOp(new ExtractFromHereOp([[$method, 'peer']])), |
| 67 | + ] |
| 68 | + ); |
| 69 | + } |
54 | 70 | } |
55 | | -$locations['storyItem'][] = new CallOp( |
| 71 | + |
| 72 | + |
| 73 | +$locations['storyViewPublicRepost'][] = new CallOp( |
56 | 74 | 'stories.getStoriesByID', |
57 | 75 | [ |
58 | | - 'id' => new ArrayOp(new ExtractFromHereOp([['storyItem', 'id']])), |
59 | | - 'peer' => new GetInputPeerOp(new ExtractFromParentOp([['peerStories', 'peer']])), |
| 76 | + 'id' => new ArrayOp(new ExtractFromHereOp([['storyViewPublicRepost', 'story'], ['storyItem', 'id']])), |
| 77 | + 'peer' => new GetInputPeerOp(new ExtractFromHereOp([['storyViewPublicRepost', 'peer_id']])), |
| 78 | + ] |
| 79 | +); |
| 80 | +$locations['storyReactionPublicRepost'][] = new CallOp( |
| 81 | + 'stories.getStoriesByID', |
| 82 | + [ |
| 83 | + 'id' => new ArrayOp(new ExtractFromHereOp([['storyReactionPublicRepost', 'story'], ['storyItem', 'id']])), |
| 84 | + 'peer' => new GetInputPeerOp(new ExtractFromHereOp([['storyReactionPublicRepost', 'peer_id']])), |
| 85 | + ] |
| 86 | +); |
| 87 | + |
| 88 | +$locations['peerStories'][] = new CallOp( |
| 89 | + 'stories.getStoriesByID', |
| 90 | + [ |
| 91 | + 'id' => new ArrayOp(new ExtractFromHereOp([['peerStories', 'stories', ExtractFromHereOp::FLAG_UNPACK_ARRAY], ['storyItem', 'id']])), |
| 92 | + 'peer' => new GetInputPeerOp(new ExtractFromHereOp([['peerStories', 'peer']])), |
60 | 93 | ] |
61 | 94 | ); |
62 | 95 |
|
|
91 | 124 | 'peer' => new GetInputPeerOp(new ExtractFromHereOp([['storyItem', 'from_id', ExtractFromHereOp::FLAG_IF_ABSENT_ABORT]])), |
92 | 125 | ]); |
93 | 126 | $locations['messages.getSponsoredMessages'][] = new CopyMethodCallOp('messages.getSponsoredMessages'); |
94 | | -$locations['channelAdminLogEvent'][] = new CallOp( |
| 127 | +/*$locations['channelAdminLogEvent'][] = new CallOp( |
95 | 128 | 'channels.getAdminLog', |
96 | 129 | [ |
97 | 130 | 'channel' => new GetInputChannelOp(new ExtractFromParentOp([['channels.getAdminLog', 'channel']])), |
|
100 | 133 | 'limit' => new PrimitiveLiteralOp('int', 1), |
101 | 134 | 'q' => new PrimitiveLiteralOp('string', ''), |
102 | 135 | ] |
| 136 | +);*/ |
| 137 | + |
| 138 | +$locations['channels.getAdminLog'][] = new CallOp( |
| 139 | + 'channels.getAdminLog', |
| 140 | + [ |
| 141 | + 'channel' => new GetInputChannelOp(new ExtractFromHereOp([['channels.getAdminLog', 'channel']])), |
| 142 | + 'max_id' => new ExtractFromHereOp([ |
| 143 | + ['channels.getAdminLog', ''], |
| 144 | + ['channels.adminLogResults', 'events', ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 145 | + ['channelAdminLogEvent', 'id'] |
| 146 | + ]), |
| 147 | + 'min_id' => new ExtractFromHereOp([ |
| 148 | + ['channels.getAdminLog', ''], |
| 149 | + ['channels.adminLogResults', 'events', ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 150 | + ['channelAdminLogEvent', 'id'] |
| 151 | + ]), |
| 152 | + 'limit' => new PrimitiveLiteralOp('int', 1), |
| 153 | + 'q' => new PrimitiveLiteralOp('string', ''), |
| 154 | + ] |
103 | 155 | ); |
| 156 | + |
104 | 157 | $locations['bots.getPreviewMedias'][] = new CopyMethodCallOp('bots.getPreviewMedias'); |
105 | 158 | $locations['bots.getPreviewInfo'][] = new CopyMethodCallOp('bots.getPreviewInfo'); |
106 | 159 | $locations['bots.addPreviewMedia'][] = new CallOp('bots.getPreviewInfo', [ |
|
142 | 195 | $starMethods = []; |
143 | 196 | foreach ($TL->getMethodsOfType('payments.StarsStatus') as $method => $_) { |
144 | 197 | $starMethods[$method] = true; |
145 | | - $locations['starsTransaction'][] = new CallOp( |
| 198 | + /*$locations['starsTransaction'][] = new CallOp( |
146 | 199 | 'payments.getStarsTransactionsByID', |
147 | 200 | [ |
148 | 201 | 'peer' => new ExtractFromParentOp([[$method, 'peer']]), |
149 | | - ...($method === 'payments.getStarsSubscriptions' ? [] : ['ton' => new ExtractFromParentOp([[$method, 'ton', ExtractFromParentOp::FLAG_PASSTHROUGH]])]), |
| 202 | + ...($method === 'payments.getStarsSubscriptions' ? [] : ['ton' => new ExtractFromParentOp([[$method, 'ton', ExtractFromHereOp::FLAG_PASSTHROUGH]])]), |
150 | 203 | 'id' => new ArrayOp(new ConstructorOp( |
151 | 204 | 'inputStarsTransaction', |
152 | 205 | [ |
153 | 206 | 'id' => new ExtractFromHereOp([['starsTransaction', 'id']]), |
154 | | - 'refund' => new ExtractFromHereOp([['starsTransaction', 'refund', ExtractFromParentOp::FLAG_PASSTHROUGH]]), |
| 207 | + 'refund' => new ExtractFromHereOp([['starsTransaction', 'refund', ExtractFromHereOp::FLAG_PASSTHROUGH]]), |
| 208 | + ] |
| 209 | + )), |
| 210 | + ] |
| 211 | + );*/ |
| 212 | + $locations[$method][] = new CallOp( |
| 213 | + 'payments.getStarsTransactionsByID', |
| 214 | + [ |
| 215 | + 'peer' => new ExtractFromHereOp([[$method, 'peer']]), |
| 216 | + ...($method === 'payments.getStarsSubscriptions' ? [] : ['ton' => new ExtractFromHereOp([[$method, 'ton', ExtractFromHereOp::FLAG_PASSTHROUGH]])]), |
| 217 | + 'id' => new ArrayOp(new ConstructorOp( |
| 218 | + 'inputStarsTransaction', |
| 219 | + [ |
| 220 | + 'id' => new ExtractFromHereOp([ |
| 221 | + [$method, ''], |
| 222 | + ['payments.starsStatus', 'history', ExtractFromHereOp::FLAG_IF_ABSENT_ABORT|ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 223 | + ['starsTransaction', 'id'] |
| 224 | + ]), |
| 225 | + 'refund' => new ExtractFromHereOp([ |
| 226 | + [$method, ''], |
| 227 | + ['payments.starsStatus', 'history', ExtractFromHereOp::FLAG_IF_ABSENT_ABORT|ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 228 | + ['starsTransaction', 'refund', ExtractFromHereOp::FLAG_PASSTHROUGH] |
| 229 | + ]), |
155 | 230 | ] |
156 | 231 | )), |
157 | 232 | ] |
|
233 | 308 | ['hash' => new PrimitiveLiteralOp('int', 0)], |
234 | 309 | ); |
235 | 310 |
|
236 | | -$locations['photo'][] = new CallOp( |
| 311 | +/*$locations['photo'][] = new CallOp( |
237 | 312 | 'photos.getUserPhotos', |
238 | 313 | [ |
239 | 314 | 'user_id' => new ExtractFromParentOp([['photos.getUserPhotos', 'user_id']]), |
240 | 315 | 'offset' => new PrimitiveLiteralOp('int', -1), |
241 | 316 | 'max_id' => new ExtractFromHereOp([['photo', 'id']]), |
242 | 317 | 'limit' => new PrimitiveLiteralOp('int', 1), |
243 | 318 | ] |
| 319 | +);*/ |
| 320 | + |
| 321 | +$locations['photos.getUserPhotos'][] = new CallOp( |
| 322 | + 'photos.getUserPhotos', |
| 323 | + [ |
| 324 | + 'user_id' => new ExtractFromHereOp([['photos.getUserPhotos', 'user_id']]), |
| 325 | + 'offset' => new PrimitiveLiteralOp('int', -1), |
| 326 | + 'max_id' => new ExtractFromHereOp([ |
| 327 | + ['photos.getUserPhotos', ''], |
| 328 | + ['photos.photos', 'photos', ExtractFromHereOp::FLAG_UNPACK_ARRAY], |
| 329 | + ['photo', 'id'] |
| 330 | + ]), |
| 331 | + 'limit' => new PrimitiveLiteralOp('int', 1), |
| 332 | + ] |
244 | 333 | ); |
| 334 | + |
245 | 335 | foreach (['photos.updateProfilePhoto', 'photos.uploadProfilePhoto'] as $method) { |
246 | 336 | $locations[$method][] = new CallOp( |
247 | 337 | 'photos.getUserPhotos', |
@@ -421,6 +511,8 @@ static function (array $stack) use ($locations, $TL, $tmp, &$validated, $storyMe |
421 | 511 | || $cons === 'foundStory' |
422 | 512 | || $cons === 'publicForwardStory' |
423 | 513 | || $cons === 'peerStories' |
| 514 | + || $cons === 'storyViewPublicRepost' |
| 515 | + || $cons === 'storyReactionPublicRepost' |
424 | 516 | ) { |
425 | 517 | return; |
426 | 518 | } |
|
0 commit comments