From 4cc983b2340cf54ea74864025ae652313223b51d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 22 May 2017 14:02:57 +0100 Subject: [PATCH] Bugfix --- src/danog/MadelineProto/MTProtoTools/UpdateHandler.php | 2 +- src/danog/MadelineProto/Wrappers/DialogHandler.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 6627cf17..b57b176b 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -38,7 +38,7 @@ trait UpdateHandler } } if (isset($this->settings['pwr']['update_handler'])) { - $this->settings['pwr']['update_handler'] === 'get_updates_update_handler' ? $this->get_updates_update_handler($update) : $this->settings['pwr']['update_handler']($update); + in_array($this->settings['pwr']['update_handler'], [['danog\MadelineProto\API', 'get_updates_update_handler'], 'get_updates_update_handler']) ? $this->get_updates_update_handler($update) : $this->settings['pwr']['update_handler']($update); } } diff --git a/src/danog/MadelineProto/Wrappers/DialogHandler.php b/src/danog/MadelineProto/Wrappers/DialogHandler.php index 031362af..fc2355cd 100644 --- a/src/danog/MadelineProto/Wrappers/DialogHandler.php +++ b/src/danog/MadelineProto/Wrappers/DialogHandler.php @@ -14,8 +14,11 @@ namespace danog\MadelineProto\Wrappers; trait DialogHandler { - public function get_dialogs() + public function get_dialogs($force = false) { + if (!isset($this->dialog_params['offset_date']) || $force) { + $this->dialog_params = ['limit' => 0, 'offset_date' => 0, 'offset_id' => 0, 'offset_peer' => ['_' => 'inputPeerEmpty']]; + } $this->getting_state = true; $res = ['dialogs' => [0]]; $datacenter = $this->datacenter->curdc;