Fixes and new get_dialogs

This commit is contained in:
Daniil Gentili 2019-06-04 13:27:21 +02:00
parent e80d67037c
commit 61114c6a92
3 changed files with 11 additions and 1 deletions

View File

@ -45,8 +45,10 @@ Powered by [amphp](https://amphp.org), MadelineProto wraps the AMPHP APIs to pro
* custom HTTP client with DoH
* no more php 5
* reset PTS to 0
* arrayaccess on args
Things to expect in the next releases:
docs for get mime funcs
docs for update_2fa
docs for ResponseException
docs for PTSException
@ -67,3 +69,4 @@ no error setting, madelineproto does that for you
do not use manual
tell about madeline.php loading in the same dire
arrayaccess on promises

View File

@ -118,7 +118,7 @@ trait ResponseHandler
$this->ack_incoming_message_id($current_msg_id, $datacenter);
// Acknowledge that I received the server's response
if ($this->authorized === self::LOGGED_IN && !$this->initing_authorization && $this->datacenter->sockets[$this->datacenter->curdc]->temp_auth_key !== null) {
if ($this->authorized === self::LOGGED_IN && !$this->initing_authorization && $this->datacenter->sockets[$this->datacenter->curdc]->temp_auth_key !== null && isset($this->updaters[false])) {
$this->updaters[false]->resumeDefer();
}

View File

@ -23,6 +23,13 @@ trait DialogHandler
{
public function get_dialogs_async($force = true)
{
if ($this->authorization['user']['bot']) {
$res = [];
foreach ($this->chats as $chat) {
$res []= $this->gen_all($chat)['Peer'];
}
return $res;
}
$res = [];
foreach (yield $this->get_full_dialogs_async($force) as $dialog) {
$res []= $dialog['peer'];