From 3939e113f571ac3be03579408795ebd7aa6874c5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 18 Jan 2020 16:11:40 +0100 Subject: [PATCH] Improve fileCallback --- docs | 2 +- src/danog/MadelineProto/MTProtoTools/Files.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs b/docs index 4ed3a844..de22c3b9 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 4ed3a8447cf21c69322bcdaf149eb3ce0befe8c0 +Subproject commit de22c3b924011923438ce6e5e60725a51089ab04 diff --git a/src/danog/MadelineProto/MTProtoTools/Files.php b/src/danog/MadelineProto/MTProtoTools/Files.php index 76154cc4..2efd554e 100644 --- a/src/danog/MadelineProto/MTProtoTools/Files.php +++ b/src/danog/MadelineProto/MTProtoTools/Files.php @@ -1205,7 +1205,7 @@ trait Files } if ($offset === $end) { - $cb(100); + $cb(100, 0, 0); return true; } $params = []; @@ -1235,7 +1235,7 @@ trait Files } if (!$params) { - $cb(100); + $cb(100, 0, 0); return true; } $count = \count($params); @@ -1256,7 +1256,7 @@ trait Files $start = \microtime(true); $size = yield $this->downloadPart($message_media, $cdn, $datacenter, $old_dc, $ige, $cb, $initParam = \array_shift($params), $callable, $seekable); if ($initParam['part_end_at'] - $initParam['part_start_at'] !== $size) { // Premature end for undefined length files - $origCb(100); + $origCb(100, 0, 0); return true; } @@ -1304,7 +1304,7 @@ trait Files } if (!isset($message_media['size'])) { - $origCb(100); + $origCb(100, 0, 0); } return true;