From caec0e51096bec41cbe317bb35b9b2e363c9b5ea Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 11 May 2019 17:18:10 +0200 Subject: [PATCH] Asyncify (5th and final pass) --- src/danog/MadelineProto/MTProtoTools/CallHandler.php | 4 ++-- src/danog/MadelineProto/TL/TL.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 1145b7ba..55d1bc1b 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -113,7 +113,7 @@ trait CallHandler if (is_array($args)) { if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max']) { - $arg_chunks = $this->split_to_chunks($args); + $arg_chunks = yield $this->split_to_chunks_async($args); $promises = []; $new_aargs = $aargs; $new_aargs['postpone'] = true; @@ -129,7 +129,7 @@ trait CallHandler return yield $promises; } - $args = $this->botAPI_to_MTProto($args); + $args = yield $this->botAPI_to_MTProto_async($args); if (isset($args['ping_id']) && is_int($args['ping_id'])) { $args['ping_id'] = $this->pack_signed_long($args['ping_id']); } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 2c329d62..8a6cd0b5 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -519,7 +519,7 @@ trait TL public function serialize_params_async($tl, $arguments, $ctx, $layer = -1) { $serialized = ''; - $arguments = $this->botAPI_to_MTProto($arguments); + $arguments = yield $this->botAPI_to_MTProto_async($arguments); $flags = 0; foreach ($tl['params'] as $cur_flag) { if (isset($cur_flag['pow'])) {