From 9c258ef406fb1866152b313f950b1febaa4c18f6 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 29 Oct 2019 22:51:14 +0100 Subject: [PATCH] c: --- src/danog/MadelineProto/CombinedAPI.php | 4 ++-- src/danog/MadelineProto/Loop/Update/FeedLoop.php | 8 ++++---- src/danog/MadelineProto/Loop/Update/SeqLoop.php | 8 ++++---- src/danog/MadelineProto/Loop/Update/UpdateLoop.php | 4 ++-- src/danog/MadelineProto/Lua.php | 2 +- src/danog/MadelineProto/MTProto.php | 6 +++--- src/danog/MadelineProto/MTProtoTools/UpdateHandler.php | 10 +++++----- src/danog/MadelineProto/Wrappers/Callback.php | 2 +- src/danog/MadelineProto/Wrappers/Events.php | 2 +- src/danog/MadelineProto/Wrappers/Loop.php | 4 ++-- src/danog/MadelineProto/Wrappers/Noop.php | 2 +- src/danog/MadelineProto/Wrappers/Webhook.php | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/danog/MadelineProto/CombinedAPI.php b/src/danog/MadelineProto/CombinedAPI.php index b4e06f50..ad211a6c 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 b8bee9e0..6c8050a3 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 cbc15c06..85a960dc 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 449e16d9..600cd68b 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 e6880606..ac96a266 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 d0d8c885..545b67a1 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 3c6b69d4..d6dd038e 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 ea5a3165..7f5a0206 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 336c28f8..4afb0511 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 581e2460..649ab4c5 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 b498c2e9..be979e29 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 271e7d7f..636e01f6 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(); } }