mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 06:39:01 +01:00
Remove useless aargs
This commit is contained in:
parent
f17ca784e9
commit
7a5e8da7cf
@ -35,5 +35,5 @@ steps:
|
||||
- TAG=${CI_COMMIT_TAG}
|
||||
commands:
|
||||
- apk add bash
|
||||
- php tests/handshake.php
|
||||
- tests/test.sh
|
||||
- php tests/handshake.php
|
||||
|
@ -115,7 +115,8 @@ trait CallHandler
|
||||
$aargs['datacenter'] = $args['id']['dc_id'];
|
||||
return $this->API->methodCallAsyncWrite($method, $args, $aargs);
|
||||
}
|
||||
if (($aargs['file'] ?? false) && !$this->isMedia() && $this->API->datacenter->has(-$this->datacenter)) {
|
||||
$file = \in_array($method, ['upload.saveFilePart', 'upload.saveBigFilePart', 'upload.getFile', 'upload.getCdnFile'], true);
|
||||
if ($file && !$this->isMedia() && $this->API->datacenter->has(-$this->datacenter)) {
|
||||
$this->logger->logger('Using media DC');
|
||||
$aargs['datacenter'] = -$this->datacenter;
|
||||
return $this->API->methodCallAsyncWrite($method, $args, $aargs);
|
||||
@ -181,7 +182,7 @@ trait CallHandler
|
||||
if (isset($aargs['msg_id'])) {
|
||||
$message->setMsgId($aargs['msg_id']);
|
||||
}
|
||||
if ($aargs['file'] ?? false) {
|
||||
if ($file) {
|
||||
$message->setFileRelated(true);
|
||||
}
|
||||
if ($aargs['botAPI'] ?? false) {
|
||||
|
@ -291,7 +291,7 @@ trait Files
|
||||
$this->methodCallAsyncWrite(...),
|
||||
$method,
|
||||
fn () => $callable($part_num),
|
||||
['heavy' => true, 'file' => true, 'datacenter' => &$datacenter]
|
||||
['heavy' => true, 'datacenter' => &$datacenter]
|
||||
);
|
||||
if (!$seekable) {
|
||||
try {
|
||||
@ -1133,7 +1133,7 @@ trait Files
|
||||
$res = $this->methodCallAsyncRead(
|
||||
$cdn ? 'upload.getCdnFile' : 'upload.getFile',
|
||||
$basic_param + $offset,
|
||||
['heavy' => true, 'file' => true, 'FloodWaitLimit' => 0, 'datacenter' => &$datacenter, 'postpone' => $postpone]
|
||||
['heavy' => true, 'FloodWaitLimit' => 0, 'datacenter' => &$datacenter, 'postpone' => $postpone]
|
||||
);
|
||||
break;
|
||||
} catch (FloodWaitError $e) {
|
||||
@ -1186,7 +1186,7 @@ trait Files
|
||||
$datacenter = 0;
|
||||
}
|
||||
while ($cdn === false && $res['type']['_'] === 'storage.fileUnknown' && $res['bytes'] === '' && $this->datacenter->has(++$datacenter)) {
|
||||
$res = $this->methodCallAsyncRead('upload.getFile', $basic_param + $offset, ['heavy' => true, 'file' => true, 'FloodWaitLimit' => 0, 'datacenter' => $datacenter]);
|
||||
$res = $this->methodCallAsyncRead('upload.getFile', $basic_param + $offset, ['heavy' => true, 'FloodWaitLimit' => 0, 'datacenter' => $datacenter]);
|
||||
}
|
||||
$res['bytes'] = (string) $res['bytes'];
|
||||
if ($res['bytes'] === '') {
|
||||
|
Loading…
Reference in New Issue
Block a user