From 2aab5e8cc8e02666d8089b48434dbc8580b0916d Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Sun, 7 Jun 2020 21:56:54 +0300 Subject: [PATCH] getParticipantsHash generator fix --- src/danog/MadelineProto/MTProtoTools/PeerHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 3e3129bc..461c67d4 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -916,7 +916,7 @@ trait PeerHandler $last_count = -1; do { try { - $gres = yield from $this->methodCallAsyncRead('channels.getParticipants', ['channel' => $channel, 'filter' => ['_' => $filter, 'q' => $q], 'offset' => $offset, 'limit' => $limit, 'hash' => $hash = $this->getParticipantsHash($channel, $filter, $q, $offset, $limit)], ['datacenter' => $this->datacenter->curdc, 'heavy' => true]); + $gres = yield from $this->methodCallAsyncRead('channels.getParticipants', ['channel' => $channel, 'filter' => ['_' => $filter, 'q' => $q], 'offset' => $offset, 'limit' => $limit, 'hash' => $hash = yield from $this->getParticipantsHash($channel, $filter, $q, $offset, $limit)], ['datacenter' => $this->datacenter->curdc, 'heavy' => true]); } catch (\danog\MadelineProto\RPCErrorException $e) { if ($e->rpc === 'CHAT_ADMIN_REQUIRED') { $this->logger->logger($e->rpc); @@ -1002,7 +1002,7 @@ trait PeerHandler $participant[$filter][$q][$offset][$limit] = $gres; $this->channel_participants[$channel['channel_id']] = $participant; } - private function getParticipantsHash($channel, $filter, $q, $offset, $limit) + private function getParticipantsHash($channel, $filter, $q, $offset, $limit): \Generator { return (yield $this->channel_participants[$channel['channel_id']])[$filter][$q][$offset][$limit]['hash'] ?? 0; }