1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 13:54:39 +01:00

Add additional caching for empty access hashes

This commit is contained in:
Daniil Gentili 2018-12-27 23:26:40 +01:00
parent 2ed2bac6f0
commit bfff131c28

View File

@ -83,6 +83,7 @@ trait PeerHandler
public function add_user($user)
{
if (!isset($user['access_hash'])) {
$this->cache_pwr_chat($user['id'], false, true);
if (isset($user['username']) && !isset($this->chats[$user['id']])) {
$this->cache_pwr_chat($user['username'], false, true);
}
@ -127,6 +128,7 @@ trait PeerHandler
case 'channelForbidden':
$bot_api_id = $this->to_supergroup($chat['id']);
if (!isset($chat['access_hash'])) {
$this->cache_pwr_chat($bot_api_id, $this->settings['peer']['full_fetch'], true);
if (isset($chat['username']) && !isset($this->chats[$bot_api_id])) {
$this->cache_pwr_chat($chat['username'], $this->settings['peer']['full_fetch'], true);
}