From d53469ee0ea1d2b94a47c81dc23ac0d033712c97 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 13 Mar 2018 11:51:37 +0000 Subject: [PATCH] Improve update management and documentation --- README.md | 3 ++- docs/index.md | 3 ++- .../MadelineProto/MTProtoTools/ResponseHandler.php | 12 +++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fee97fa9b..664e3ff80 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ $MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']); ## Documentation - [Features](https://docs.madelineproto.xyz/FULL_README.html#features) -- [Methods](https://docs.madelineproto.xyz/FULL_README.html#methods) +- [Full method list](https://docs.madelineproto.xyz/API_docs/methods) +- [How to use these methods](https://docs.madelineproto.xyz/FULL_README.html#methods) - [Clicking inline buttons](https://docs.madelineproto.xyz/FULL_README.html#inline-buttons) - [Uploading and downloading files](https://docs.madelineproto.xyz/FULL_README.html#uploading-and-downloading-files) - [Changing settings](https://docs.madelineproto.xyz/FULL_README.html#settings) diff --git a/docs/index.md b/docs/index.md index fee97fa9b..664e3ff80 100644 --- a/docs/index.md +++ b/docs/index.md @@ -47,7 +47,8 @@ $MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']); ## Documentation - [Features](https://docs.madelineproto.xyz/FULL_README.html#features) -- [Methods](https://docs.madelineproto.xyz/FULL_README.html#methods) +- [Full method list](https://docs.madelineproto.xyz/API_docs/methods) +- [How to use these methods](https://docs.madelineproto.xyz/FULL_README.html#methods) - [Clicking inline buttons](https://docs.madelineproto.xyz/FULL_README.html#inline-buttons) - [Uploading and downloading files](https://docs.madelineproto.xyz/FULL_README.html#uploading-and-downloading-files) - [Changing settings](https://docs.madelineproto.xyz/FULL_README.html#settings) diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index 8bf324826..ea98a8888 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -458,7 +458,17 @@ trait ResponseHandler $message = $updates; $message['_'] = 'message'; $message['from_id'] = $from_id; - $message['to_id'] = $this->get_info($to_id)['Peer']; + try { + $message['to_id'] = $this->get_info($to_id)['Peer']; + } catch (\danog\MadelineProto\Exception $e) { + \danog\MadelineProto\Logger::log('Still did not get user in database, postponing update', \danog\MadelineProto\Logger::ERROR); + $this->pending_updates[] = $updates; + break; + } catch (\danog\MadelineProto\RPCErrorException $e) { + \danog\MadelineProto\Logger::log('Still did not get user in database, postponing update', \danog\MadelineProto\Logger::ERROR); + $this->pending_updates[] = $updates; + break; + } $update = ['_' => 'updateNewMessage', 'message' => $message, 'pts' => $updates['pts'], 'pts_count' => $updates['pts_count']]; $this->handle_update($update, $opts); break;