diff --git a/CHANGELOG.md b/CHANGELOG.md index ebfceb8c..f23e4268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index 682417a2..a70b579b 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -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(); } diff --git a/src/danog/MadelineProto/Wrappers/DialogHandler.php b/src/danog/MadelineProto/Wrappers/DialogHandler.php index e97d047f..24a6bc93 100644 --- a/src/danog/MadelineProto/Wrappers/DialogHandler.php +++ b/src/danog/MadelineProto/Wrappers/DialogHandler.php @@ -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'];