This commit is contained in:
Daniil Gentili 2019-09-14 15:39:42 +02:00
parent 38c29240ad
commit c5506f5a74
7 changed files with 10 additions and 10 deletions

2
docs

@ -1 +1 @@
Subproject commit fe346258733323e5173e674f15059dea1a1eb880 Subproject commit 042cc04351a461f551a9de7bf704290040910b37

View File

@ -33,7 +33,7 @@ class API extends APIFactory
public $session; public $session;
public $serialized = 0; public $serialized = 0;
/** /**
* Instance of MadelineProto * Instance of MadelineProto.
* *
* @var MTProto * @var MTProto
*/ */

View File

@ -212,7 +212,7 @@ final class Coroutine implements Promise, \ArrayAccess
} }
/** /**
* Get stacktrace from when the generator was started * Get stacktrace from when the generator was started.
* *
* @param integer $options Backtrace options * @param integer $options Backtrace options
* *

View File

@ -230,7 +230,9 @@ class MinDatabase implements TLCallback
throw new \danog\MadelineProto\Exception("Unknown origin type provided: {$data['_']}"); throw new \danog\MadelineProto\Exception("Unknown origin type provided: {$data['_']}");
} }
foreach ($cache as $id) { foreach ($cache as $id) {
if ($origin['peer'] === $id) continue; if ($origin['peer'] === $id) {
continue;
}
$this->db[$id] = $origin; $this->db[$id] = $origin;
} }
$this->API->logger->logger("Added origin ({$data['_']}) to ".\count($cache).' peer locations', \danog\MadelineProto\Logger::ULTRA_VERBOSE); $this->API->logger->logger("Added origin ({$data['_']}) to ".\count($cache).' peer locations', \danog\MadelineProto\Logger::ULTRA_VERBOSE);

View File

@ -58,8 +58,7 @@ trait PeerHandler
if (isset($this->chats[$user['id']]['access_hash']) && $this->chats[$user['id']]['access_hash']) { if (isset($this->chats[$user['id']]['access_hash']) && $this->chats[$user['id']]['access_hash']) {
$this->logger->logger("No access hash with user {$user['id']}, using backup"); $this->logger->logger("No access hash with user {$user['id']}, using backup");
$user['access_hash'] = $this->chats[$user['id']]['access_hash']; $user['access_hash'] = $this->chats[$user['id']]['access_hash'];
} elseif (!isset($this->caching_simple[$user['id']]) && !(isset($user['username']) && isset($this->caching_simple_username[$user['username']]))) {
} else if (!isset($this->caching_simple[$user['id']]) && !(isset($user['username']) && isset($this->caching_simple_username[$user['username']]))) {
$this->logger->logger("No access hash with user {$user['id']}, trying to fetch by ID..."); $this->logger->logger("No access hash with user {$user['id']}, trying to fetch by ID...");
if (isset($user['username']) && !isset($this->caching_simple_username[$user['username']])) { if (isset($user['username']) && !isset($this->caching_simple_username[$user['username']])) {
$this->caching_possible_username[$user['id']] = $user['username']; $this->caching_possible_username[$user['id']] = $user['username'];
@ -509,6 +508,7 @@ trait PeerHandler
} }
foreach ($this->chats as $bot_api_id => $chat) { foreach ($this->chats as $bot_api_id => $chat) {
if (isset($chat['username']) && \strtolower($chat['username']) === $id) { if (isset($chat['username']) && \strtolower($chat['username']) === $id) {
if ($chat['min'] ?? false) {
$this->logger->logger("Only have min peer for $bot_api_id in database, trying to fetch full info"); $this->logger->logger("Only have min peer for $bot_api_id in database, trying to fetch full info");
try { try {
if ($bot_api_id < 0) { if ($bot_api_id < 0) {
@ -521,6 +521,7 @@ trait PeerHandler
} catch (\danog\MadelineProto\RPCErrorException $e) { } catch (\danog\MadelineProto\RPCErrorException $e) {
$this->logger->logger($e->getMessage(), \danog\MadelineProto\Logger::WARNING); $this->logger->logger($e->getMessage(), \danog\MadelineProto\Logger::WARNING);
} }
}
return $this->gen_all($chat, $folder_id); return $this->gen_all($chat, $folder_id);
} }

View File

@ -19,8 +19,6 @@
namespace danog\MadelineProto\TL; namespace danog\MadelineProto\TL;
use danog\MadelineProto\Tools;
trait PrettyException trait PrettyException
{ {
public $tl_trace; public $tl_trace;

View File

@ -25,7 +25,6 @@ use Amp\Loop;
use Amp\Promise; use Amp\Promise;
use Amp\Success; use Amp\Success;
use phpseclib\Math\BigInteger; use phpseclib\Math\BigInteger;
use ReflectionGenerator;
use function Amp\ByteStream\getOutputBufferStream; use function Amp\ByteStream\getOutputBufferStream;
use function Amp\ByteStream\getStdin; use function Amp\ByteStream\getStdin;