diff --git a/src/danog/MadelineProto/CombinedAPI.php b/src/danog/MadelineProto/CombinedAPI.php index b4e06f501..ad211a6c8 100644 --- a/src/danog/MadelineProto/CombinedAPI.php +++ b/src/danog/MadelineProto/CombinedAPI.php @@ -238,8 +238,8 @@ class CombinedAPI if ($instance->API->authorized !== MTProto::LOGGED_IN) { continue; } - if (!$instance->API->settings['updates']['handleUpdates']) { - $instance->API->settings['updates']['handleUpdates'] = true; + if (!$instance->API->settings['updates']['handle_updates']) { + $instance->API->settings['updates']['handle_updates'] = true; $instance->API->startUpdateSystem(); } $instance->setCallback(function ($update) use ($path) { diff --git a/src/danog/MadelineProto/Loop/Update/FeedLoop.php b/src/danog/MadelineProto/Loop/Update/FeedLoop.php index b8bee9e01..6c8050a3b 100644 --- a/src/danog/MadelineProto/Loop/Update/FeedLoop.php +++ b/src/danog/MadelineProto/Loop/Update/FeedLoop.php @@ -50,11 +50,11 @@ class FeedLoop extends ResumableSignalLoop $API = $this->API; $this->updater = $API->updaters[$this->channelId]; - if (!$this->API->settings['updates']['handleUpdates']) { + if (!$this->API->settings['updates']['handle_updates']) { return false; } - while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -62,7 +62,7 @@ class FeedLoop extends ResumableSignalLoop $this->state = $this->channelId === false ? (yield $API->loadUpdateState()) : $API->loadChannelState($this->channelId); while (true) { - while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -70,7 +70,7 @@ class FeedLoop extends ResumableSignalLoop if (yield $this->waitSignal($this->pause())) { return; } - if (!$this->API->settings['updates']['handleUpdates']) { + if (!$this->API->settings['updates']['handle_updates']) { return; } $API->logger->logger("Resumed $this"); diff --git a/src/danog/MadelineProto/Loop/Update/SeqLoop.php b/src/danog/MadelineProto/Loop/Update/SeqLoop.php index cbc15c066..85a960dc5 100644 --- a/src/danog/MadelineProto/Loop/Update/SeqLoop.php +++ b/src/danog/MadelineProto/Loop/Update/SeqLoop.php @@ -42,11 +42,11 @@ class SeqLoop extends ResumableSignalLoop $API = $this->API; $this->feeder = $API->feeders[false]; - if (!$this->API->settings['updates']['handleUpdates']) { + if (!$this->API->settings['updates']['handle_updates']) { return false; } - while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -54,7 +54,7 @@ class SeqLoop extends ResumableSignalLoop $this->state = yield $API->loadUpdateState(); while (true) { - while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -62,7 +62,7 @@ class SeqLoop extends ResumableSignalLoop if (yield $this->waitSignal($this->pause())) { return; } - if (!$this->API->settings['updates']['handleUpdates']) { + if (!$this->API->settings['updates']['handle_updates']) { return; } while ($this->incomingUpdates) { diff --git a/src/danog/MadelineProto/Loop/Update/UpdateLoop.php b/src/danog/MadelineProto/Loop/Update/UpdateLoop.php index 449e16d9b..600cd68b0 100644 --- a/src/danog/MadelineProto/Loop/Update/UpdateLoop.php +++ b/src/danog/MadelineProto/Loop/Update/UpdateLoop.php @@ -47,7 +47,7 @@ class UpdateLoop extends ResumableSignalLoop $API = $this->API; $feeder = $this->feeder = $API->feeders[$this->channelId]; - while (!$API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { $API->logger->logger("Exiting $this due to signal"); @@ -59,7 +59,7 @@ class UpdateLoop extends ResumableSignalLoop $timeout = $API->settings['updates']['getdifference_interval']; $first = true; while (true) { - while (!$API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { + while (!$API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { $API->logger->logger("Exiting $this due to signal"); diff --git a/src/danog/MadelineProto/Lua.php b/src/danog/MadelineProto/Lua.php index e6880606f..ac96a2667 100644 --- a/src/danog/MadelineProto/Lua.php +++ b/src/danog/MadelineProto/Lua.php @@ -32,7 +32,7 @@ class Lua throw new Exception(\danog\MadelineProto\Lang::$current_lang['script_not_exist']); } $this->MadelineProto = $MadelineProto; - $this->MadelineProto->settings['updates']['handleUpdates'] = true; + $this->MadelineProto->settings['updates']['handle_updates'] = true; $this->MadelineProto->API->datacenter->sockets[$this->MadelineProto->settings['connection_settings']['default_dc']]->startUpdateLoop(); $this->script = $script; diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index d0d8c8852..545b67a1a 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -816,7 +816,7 @@ class MTProto extends AsyncConstruct implements TLCallback if ($this->authorized === self::LOGGED_IN && !$this->authorization['user']['bot'] && $this->settings['peer']['cache_all_peers_on_startup']) { yield $this->getDialogs($force); } - if ($this->authorized === self::LOGGED_IN && $this->settings['updates']['handleUpdates']) { + if ($this->authorized === self::LOGGED_IN && $this->settings['updates']['handle_updates']) { $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['getupdates_deserialization'], Logger::NOTICE); yield $this->updaters[false]->resume(); } @@ -1113,7 +1113,7 @@ class MTProto extends AsyncConstruct implements TLCallback // Should madeline fetch the full member list of every group it meets? 'cache_all_peers_on_startup' => false, ], 'requests' => ['gzip_encode_if_gt' => 1024 * 1024], 'updates' => [ - 'handleUpdates' => false, + 'handle_updates' => false, // Should I handle updates? 'handle_old_updates' => true, // Should I handle old updates on startup? @@ -1182,7 +1182,7 @@ class MTProto extends AsyncConstruct implements TLCallback throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['api_not_set'], 0, null, 'MadelineProto', 1); } $this->settings = $settings; - if (!$this->settings['updates']['handleUpdates']) { + if (!$this->settings['updates']['handle_updates']) { $this->updates = []; } // Setup logger diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 3c6b69d4c..d6dd038e7 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -48,7 +48,7 @@ trait UpdateHandler public function getUpdatesUpdateHandler($update) { - if (!$this->settings['updates']['handleUpdates']) { + if (!$this->settings['updates']['handle_updates']) { return; } $this->updates[$this->updates_key++] = $update; @@ -56,8 +56,8 @@ trait UpdateHandler public function getUpdates($params = []) { - if (!$this->settings['updates']['handleUpdates']) { - $this->settings['updates']['handleUpdates'] = true; + if (!$this->settings['updates']['handle_updates']) { + $this->settings['updates']['handle_updates'] = true; $this->startUpdateSystem(); } if (!$this->settings['updates']['run_callback']) { @@ -173,7 +173,7 @@ trait UpdateHandler public function handleUpdates($updates, $actual_updates = null) { - if (!$this->settings['updates']['handleUpdates']) { + if (!$this->settings['updates']['handle_updates']) { return; } if ($actual_updates) { @@ -365,7 +365,7 @@ trait UpdateHandler //if ($update['_'] === 'updateServiceNotification' && strpos($update['type'], 'AUTH_KEY_DROP_') === 0) { //} - if (!$this->settings['updates']['handleUpdates']) { + if (!$this->settings['updates']['handle_updates']) { return; } if (isset($update['message']['_']) && $update['message']['_'] === 'messageEmpty') { diff --git a/src/danog/MadelineProto/Wrappers/Callback.php b/src/danog/MadelineProto/Wrappers/Callback.php index ea5a31658..7f5a02068 100644 --- a/src/danog/MadelineProto/Wrappers/Callback.php +++ b/src/danog/MadelineProto/Wrappers/Callback.php @@ -28,7 +28,7 @@ trait Callback { $this->settings['updates']['callback'] = $callback; $this->settings['updates']['run_callback'] = true; - $this->settings['updates']['handleUpdates'] = true; + $this->settings['updates']['handle_updates'] = true; $this->startUpdateSystem(); } } diff --git a/src/danog/MadelineProto/Wrappers/Events.php b/src/danog/MadelineProto/Wrappers/Events.php index 336c28f8b..4afb0511d 100644 --- a/src/danog/MadelineProto/Wrappers/Events.php +++ b/src/danog/MadelineProto/Wrappers/Events.php @@ -59,7 +59,7 @@ trait Events } $this->settings['updates']['callback'] = [$this, 'eventUpdateHandler']; - $this->settings['updates']['handleUpdates'] = true; + $this->settings['updates']['handle_updates'] = true; $this->settings['updates']['run_callback'] = true; if (!$this->asyncInitPromise) { $this->startUpdateSystem(); diff --git a/src/danog/MadelineProto/Wrappers/Loop.php b/src/danog/MadelineProto/Wrappers/Loop.php index 581e2460e..649ab4c5d 100644 --- a/src/danog/MadelineProto/Wrappers/Loop.php +++ b/src/danog/MadelineProto/Wrappers/Loop.php @@ -140,8 +140,8 @@ trait Loop $this->closeConnection('Bot was started'); } - if (!$this->settings['updates']['handleUpdates']) { - $this->settings['updates']['handleUpdates'] = true; + if (!$this->settings['updates']['handle_updates']) { + $this->settings['updates']['handle_updates'] = true; } if (!$this->settings['updates']['run_callback']) { $this->settings['updates']['run_callback'] = true; diff --git a/src/danog/MadelineProto/Wrappers/Noop.php b/src/danog/MadelineProto/Wrappers/Noop.php index b498c2e98..be979e294 100644 --- a/src/danog/MadelineProto/Wrappers/Noop.php +++ b/src/danog/MadelineProto/Wrappers/Noop.php @@ -25,7 +25,7 @@ trait Noop { $this->settings['updates']['callback'] = [$this, 'noop']; $this->settings['updates']['run_callback'] = false; - $this->settings['updates']['handleUpdates'] = true; + $this->settings['updates']['handle_updates'] = true; $this->startUpdateSystem(); } diff --git a/src/danog/MadelineProto/Wrappers/Webhook.php b/src/danog/MadelineProto/Wrappers/Webhook.php index 271e7d7fb..636e01f6e 100644 --- a/src/danog/MadelineProto/Wrappers/Webhook.php +++ b/src/danog/MadelineProto/Wrappers/Webhook.php @@ -30,7 +30,7 @@ trait Webhook $this->hook_url = $hook_url; $this->settings['updates']['callback'] = [$this, 'pwrWebhook']; $this->settings['updates']['run_callback'] = true; - $this->settings['updates']['handleUpdates'] = true; + $this->settings['updates']['handle_updates'] = true; $this->startUpdateSystem(); } }