From 552e82ca64efbf1bf6e8e833757af3c9f461d9de Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 19 Jun 2023 10:15:39 +0200 Subject: [PATCH] Bugfix --- README.md | 3 +-- docs | 2 +- src/DataCenterConnection.php | 4 +++- src/Lang.php | 12 ++++++++---- src/TL/Types/LoginQrCode.php | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c41b03684..3e28c3631 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,7 @@ Want to add your own open-source project to this list? [Click here!](https://doc * [Manual (user)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-user) * [API ID](https://docs.madelineproto.xyz/docs/LOGIN.html#api-id) * [Manual (bot)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-bot) - * [Logout](https://docs.madelineproto.xyz/docs/LOGIN.html#logout) - * [Changing 2FA password](https://docs.madelineproto.xyz/docs/LOGIN.html#changing-2fa-password) + * [QR code login (user)](https://docs.madelineproto.xyz/docs/LOGIN.html#qr-code-user) * [Features](https://docs.madelineproto.xyz/docs/FEATURES.html) * [Requirements](https://docs.madelineproto.xyz/docs/REQUIREMENTS.html) * [MadelineProto on Docker](https://docs.madelineproto.xyz/docs/DOCKER.html) diff --git a/docs b/docs index 6936aa270..ddbcd8e6c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6936aa2703675f1b144d613e69e4922b51ea358f +Subproject commit ddbcd8e6c0eadc29134a7416e4a2ab6158de43d6 diff --git a/src/DataCenterConnection.php b/src/DataCenterConnection.php index 86afe0abc..50e01ebb7 100644 --- a/src/DataCenterConnection.php +++ b/src/DataCenterConnection.php @@ -404,7 +404,9 @@ final class DataCenterConnection implements JsonSerializable */ public function flush(): void { - if (!isset($this->datacenter)) return; + if (!isset($this->datacenter)) { + return; + } $this->API->logger->logger("Flushing pending messages, DC {$this->datacenter}", Logger::NOTICE); foreach ($this->connections as $socket) { $socket->flush(); diff --git a/src/Lang.php b/src/Lang.php index 4f700739d..22888e1c1 100644 --- a/src/Lang.php +++ b/src/Lang.php @@ -140,11 +140,13 @@ final class Lang 'apiManualPrompt0' => 'Inserisci il tuo API ID: ', 'apiManualPrompt1' => 'Inserisci il tuo API hash: ', 'apiParamsError' => 'Non hai fornito tutti i parametri richiesti!', + 'loginBot' => 'Inserisci il tuo bot token: ', 'loginQr' => 'Scansiona il codice QR per fare il login automaticamente.', 'loginManual' => 'In alternativa, puoi inserire un bot token o un numero di telefono per effettuare il login manualmente: ', 'loginNoCode' => 'Non hai fornito un codice di verifica!', 'loginNoName' => 'Non hai fornito un nome!', 'loginNoPass' => 'Non hai fornito la password!', + 'loginUser' => 'Inserisci il tuo numero di telefono: ', 'loginUserPass' => 'Inserisci la tua password (suggerimento %s): ', 'loginUserPassHint' => 'Suggerimento: %s', 'loginUserPassWeb' => 'Inserisci la tua password: ', @@ -175,10 +177,6 @@ final class Lang 'en' => [ 'go' => 'Go', - 'loginChoosePromptWeb' => 'Do you want to login as a user or as a bot?', - 'loginWebQr' => 'You can also login automatically by scanning the following QR code:', - 'loginOptionBot' => 'Bot', - 'loginOptionUser' => 'User', 'apiChooseManualAutoTip' => 'Note that you can also provide the API ID/hash directly in the code using the settings: %s', 'apiChooseManualAutoTipWeb' => 'Note that you can also provide the API ID/hash directly in the code using the settings.', 'apiChoosePrompt' => 'Your choice (m/a): ', @@ -205,6 +203,12 @@ final class Lang 'apiAppInstructionsAutoTypeOther' => 'Other (specify in description)', 'apiParamsError' => 'You didn\'t provide all of the required parameters!', 'apiError' => 'ERROR: %s. Try again.', + 'loginChoosePromptWeb' => 'Do you want to login as a user or as a bot?', + 'loginWebQr' => 'You can also login automatically by scanning the following QR code:', + 'loginOptionBot' => 'Bot', + 'loginOptionUser' => 'User', + 'loginBot' => 'Enter your bot token: ', + 'loginUser' => 'Enter your phone number: ', 'loginQr' => "Scan the above QR code to login automatically.", 'loginManual' => 'Alternatively, you can also enter a bot token or phone number to login manually: ', 'loginUserCode' => 'Enter the code: ', diff --git a/src/TL/Types/LoginQrCode.php b/src/TL/Types/LoginQrCode.php index ef91feccc..ca6540814 100644 --- a/src/TL/Types/LoginQrCode.php +++ b/src/TL/Types/LoginQrCode.php @@ -36,7 +36,7 @@ use danog\MadelineProto\MTProto; use JsonSerializable; /** - * Represents a login QR code. + * Represents a login QR code. * The `link` public readonly property contains the [QR code login link](https://core.telegram.org/api/links#qr-code-login-links). * The `expiry` public readonly property contains the expiry date of the link. */