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;