Fixes and improvements
This commit is contained in:
parent
9317a9feed
commit
751aedf92b
|
@ -17,7 +17,8 @@
|
|||
* 2fa+++++
|
||||
* improved callfork
|
||||
* split acks
|
||||
|
||||
* TL callabck
|
||||
* channel state
|
||||
Things to expect in the next releases:
|
||||
Document async apis
|
||||
optional max_id and min_id
|
||||
|
|
|
@ -58,7 +58,8 @@ class CheckLoop extends ResumableSignalLoop
|
|||
if ($connection->hasPendingCalls()) {
|
||||
$last_recv = $connection->get_max_id(true);
|
||||
if ($connection->temp_auth_key !== null) {
|
||||
$message_ids = $connection->getPendingCalls(); //array_values($connection->new_outgoing);
|
||||
$full_message_ids = $connection->getPendingCalls(); //array_values($connection->new_outgoing);
|
||||
foreach (array_chunk($full_message_ids, 8192) as $message_ids) {
|
||||
$deferred = new Deferred();
|
||||
$deferred->promise()->onResolve(
|
||||
function ($e, $result) use ($message_ids, $API, $connection, $datacenter) {
|
||||
|
@ -121,6 +122,7 @@ class CheckLoop extends ResumableSignalLoop
|
|||
}
|
||||
$API->logger->logger("Still missing $list on DC $datacenter, sending state request", \danog\MadelineProto\Logger::ERROR);
|
||||
yield $API->object_call_async('msgs_state_req', ['msg_ids' => $message_ids], ['datacenter' => $datacenter, 'promise' => $deferred]);
|
||||
}
|
||||
} else {
|
||||
foreach ($connection->new_outgoing as $message_id) {
|
||||
if (isset($connection->outgoing_messages[$message_id]['sent'])
|
||||
|
|
|
@ -404,7 +404,7 @@ class MTProto extends AsyncConstruct implements TLCallback
|
|||
}
|
||||
|
||||
if (!$this->settings['updates']['handle_old_updates']) {
|
||||
$this->channels_state = new CombinedUpdatesState([false => new UpdatesState()]);
|
||||
$this->channels_state = new CombinedUpdatesState();
|
||||
$this->got_state = false;
|
||||
}
|
||||
yield $this->connect_to_all_dcs_async();
|
||||
|
|
|
@ -27,10 +27,10 @@ class CombinedUpdatesState
|
|||
private $states = [];
|
||||
public function __construct($init = [])
|
||||
{
|
||||
$this->states[false] = new UpdatesState();
|
||||
if (!is_array($init)) {
|
||||
return;
|
||||
}
|
||||
$this->states[false] = new UpdatesState();
|
||||
foreach ($init as $channel => $state) {
|
||||
if (is_array($state)) {
|
||||
$state = new UpdatesState($state, $channel);
|
||||
|
|
|
@ -73,7 +73,7 @@ trait ApiTemplates
|
|||
<li>Click on create application</li>
|
||||
</ol>', '<input type="string" name="api_id" placeholder="API ID" required/><input type="string" name="api_hash" placeholder="API hash" required/>'));
|
||||
} else {
|
||||
yield $stdout->write($this->web_api_echo_template('Enter your phone number<br><b>'.$message.'</b>', '<input type="text" name="phone_number" placeholder="Phone number" required/>'));
|
||||
yield $stdout->write($this->web_api_echo_template('Enter a phone number that is <b>already registered</b> on telegram to get the API ID<br><b>'.$message.'</b>', '<input type="text" name="phone_number" placeholder="Phone number" required/>'));
|
||||
}
|
||||
} else {
|
||||
if ($message) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user