From 5a05e81fda65306bd2e16771e901a20f82cffb24 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 17 Jan 2017 21:49:53 +0100 Subject: [PATCH] Bugfix --- composer.lock | 11 +++++------ src/danog/MadelineProto/MTProtoTools/PeerHandler.php | 11 ++++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index a9da3b07..db5b313e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,6 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b1210d4490e9d7e46ea39393f02b77d6", "content-hash": "e220f48be9907b7881feacec0528a3e8", "packages": [ { @@ -58,7 +57,7 @@ "struct", "unpack" ], - "time": "2016-11-14 15:09:50" + "time": "2016-11-14T15:09:50+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -119,7 +118,7 @@ "hex2bin", "rfc4648" ], - "time": "2016-07-11 20:32:06" + "time": "2016-07-11T20:32:06+00:00" }, { "name": "paragonie/random_compat", @@ -167,7 +166,7 @@ "pseudorandom", "random" ], - "time": "2016-11-07 23:38:38" + "time": "2016-11-07T23:38:38+00:00" }, { "name": "phpseclib/phpseclib", @@ -259,7 +258,7 @@ "x.509", "x509" ], - "time": "2016-10-04 00:57:04" + "time": "2016-10-04T00:57:04+00:00" }, { "name": "vlucas/phpdotenv", @@ -309,7 +308,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2016-09-01T10:05:43+00:00" } ], "packages-dev": [], diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 8fcda2c6..62c0a720 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -359,6 +359,7 @@ trait PeerHandler } if (isset($res['participants'])) { foreach ($res['participants'] as $key => $participant) { + $newres = []; $newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false); if (isset($participant['inviter_id'])) { $newres['inviter'] = $this->get_pwr_chat($participant['inviter_id'], false, false); @@ -384,13 +385,14 @@ trait PeerHandler } if (!isset($res['participants']) && isset($res['can_view_participants']) && $res['can_view_participants']) { $res['participants'] = []; - $limit = 200; + $limit = 400; $offset = -$limit; $gres = $this->method_call('channels.getParticipants', ['channel' => $full['InputChannel'], 'filter' => ['_' => 'channelParticipantsRecent'], 'offset' => $offset += $limit, 'limit' => 200]); $count = $gres['count']; - $key = 0; + $key = -1; while ($offset <= $count) { foreach ($gres['participants'] as $participant) { + $newres = []; $newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false); $key++; if (isset($participant['inviter_id'])) { @@ -423,13 +425,12 @@ trait PeerHandler } $res['participants'][$key] = $newres; } - $gres = $this->method_call('channels.getParticipants', ['channel' => $full['InputChannel'], 'filter' => ['_' => 'channelParticipantsRecent'], 'offset' => $offset += $limit, 'limit' => 200]); + $gres = $this->method_call('channels.getParticipants', ['channel' => $full['InputChannel'], 'filter' => ['_' => 'channelParticipantsRecent'], 'offset' => $offset += $limit, 'limit' => $limit]); } } if ($fullfetch || $send) { $this->store_db($res); } - return $res; } @@ -468,7 +469,7 @@ trait PeerHandler \danog\MadelineProto\Logger::log($e->getMessage()); } $this->qres = []; - $this->last_stored = time() + 5; + $this->last_stored = time() + 10; } public function resolve_username($username)