This commit is contained in:
Daniil Gentili 2017-01-17 21:49:53 +01:00
parent 97e2ae9806
commit 5a05e81fda
2 changed files with 11 additions and 11 deletions

11
composer.lock generated
View File

@ -4,7 +4,6 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "b1210d4490e9d7e46ea39393f02b77d6",
"content-hash": "e220f48be9907b7881feacec0528a3e8", "content-hash": "e220f48be9907b7881feacec0528a3e8",
"packages": [ "packages": [
{ {
@ -58,7 +57,7 @@
"struct", "struct",
"unpack" "unpack"
], ],
"time": "2016-11-14 15:09:50" "time": "2016-11-14T15:09:50+00:00"
}, },
{ {
"name": "paragonie/constant_time_encoding", "name": "paragonie/constant_time_encoding",
@ -119,7 +118,7 @@
"hex2bin", "hex2bin",
"rfc4648" "rfc4648"
], ],
"time": "2016-07-11 20:32:06" "time": "2016-07-11T20:32:06+00:00"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
@ -167,7 +166,7 @@
"pseudorandom", "pseudorandom",
"random" "random"
], ],
"time": "2016-11-07 23:38:38" "time": "2016-11-07T23:38:38+00:00"
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
@ -259,7 +258,7 @@
"x.509", "x.509",
"x509" "x509"
], ],
"time": "2016-10-04 00:57:04" "time": "2016-10-04T00:57:04+00:00"
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
@ -309,7 +308,7 @@
"env", "env",
"environment" "environment"
], ],
"time": "2016-09-01 10:05:43" "time": "2016-09-01T10:05:43+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View File

@ -359,6 +359,7 @@ trait PeerHandler
} }
if (isset($res['participants'])) { if (isset($res['participants'])) {
foreach ($res['participants'] as $key => $participant) { foreach ($res['participants'] as $key => $participant) {
$newres = [];
$newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false); $newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false);
if (isset($participant['inviter_id'])) { if (isset($participant['inviter_id'])) {
$newres['inviter'] = $this->get_pwr_chat($participant['inviter_id'], false, false); $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']) { if (!isset($res['participants']) && isset($res['can_view_participants']) && $res['can_view_participants']) {
$res['participants'] = []; $res['participants'] = [];
$limit = 200; $limit = 400;
$offset = -$limit; $offset = -$limit;
$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' => 200]);
$count = $gres['count']; $count = $gres['count'];
$key = 0; $key = -1;
while ($offset <= $count) { while ($offset <= $count) {
foreach ($gres['participants'] as $participant) { foreach ($gres['participants'] as $participant) {
$newres = [];
$newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false); $newres['user'] = $this->get_pwr_chat($participant['user_id'], false, false);
$key++; $key++;
if (isset($participant['inviter_id'])) { if (isset($participant['inviter_id'])) {
@ -423,13 +425,12 @@ trait PeerHandler
} }
$res['participants'][$key] = $newres; $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) { if ($fullfetch || $send) {
$this->store_db($res); $this->store_db($res);
} }
return $res; return $res;
} }
@ -468,7 +469,7 @@ trait PeerHandler
\danog\MadelineProto\Logger::log($e->getMessage()); \danog\MadelineProto\Logger::log($e->getMessage());
} }
$this->qres = []; $this->qres = [];
$this->last_stored = time() + 5; $this->last_stored = time() + 10;
} }
public function resolve_username($username) public function resolve_username($username)