Skip to content

Commit 09a7da6

Browse files
committed
Web login: choose the session to log in with startAndLoopMulti()
In the browser, startAndLoopMulti() started its instances in order, and the first that wasn't logged in showed its login page: the others could only be logged in one after the other. A logged-in instance started first also answered the QR code polls of the next one's page with logged_in: true, reloading the page in a loop. When more than one session isn't logged in, the login pages now show a dropdown of them (named by their key in the array, or the basename of the session): choosing one loads its page, with ?madelineSession=<key>. The session chosen (or the first one not logged in) is started first, so it answers the requests of its page, which keep the parameter. In the web app: a strip of glass above the card, the options as an ordered list (a JSON object puts integer keys first). Without JavaScript: a GET form with a Switch button, keeping the query of the page. The strings are translated in every language. A test of the app left its POST pending forever, leaking a submission into the next tests: it ends it. Claude-Session: https://claude.ai/code/session_0185K6MyhFXHvLLtf79c6Xif
1 parent dc8a810 commit 09a7da6

40 files changed

Lines changed: 499 additions & 12 deletions

‎langs/ar.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "تسجيل الدخول إلى Telegram",
187187
"loginLeadWeb": "اختر الحساب أو البوت الذي ستعمل به نسخة MadelineProto هذه.",
188188
"loginTypeWeb": "تسجيل الدخول كـ",
189+
"loginSessionWeb": "الجلسة",
190+
"loginSessionSwitchWeb": "تبديل",
189191
"loginUserPhoneHintWeb": "مع رمز الدولة، مثل +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "التوكن الذي أعطاك إياه @BotFather عند إنشاء البوت.",
191193
"loginCodeTitleWeb": "أدخل رمز تسجيل الدخول",

‎langs/ckb.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "چوونەژوورەوە بۆ Telegram",
187187
"loginLeadWeb": "ئەو ئەکاونت یان بۆتە هەڵبژێرە کە ئەم نموونەیەی MadelineProto وەک ئەو کاردەکات.",
188188
"loginTypeWeb": "چوونەژوورەوە وەک",
189+
"loginSessionWeb": "دانیشتن",
190+
"loginSessionSwitchWeb": "گۆڕین",
189191
"loginUserPhoneHintWeb": "لەگەڵ کۆدی وڵات، وەک +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "ئەو تۆکنەی @BotFather پێی دایت کاتێک بۆتەکەت دروست کرد.",
191193
"loginCodeTitleWeb": "کۆدی چوونەژوورەوە داخڵ بکە",

‎langs/de.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Bei Telegram anmelden",
187187
"loginLeadWeb": "Wählen Sie das Konto oder den Bot, als der diese MadelineProto-Instanz laufen soll.",
188188
"loginTypeWeb": "Anmelden als",
189+
"loginSessionWeb": "Sitzung",
190+
"loginSessionSwitchWeb": "Wechseln",
189191
"loginUserPhoneHintWeb": "Mit Ländervorwahl, z. B. +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "Das Token, das Ihnen @BotFather beim Erstellen des Bots gegeben hat.",
191193
"loginCodeTitleWeb": "Anmeldecode eingeben",

‎langs/en.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Log in to Telegram",
187187
"loginLeadWeb": "Choose the account or the bot this MadelineProto instance will run as.",
188188
"loginTypeWeb": "Log in as",
189+
"loginSessionWeb": "Session",
190+
"loginSessionSwitchWeb": "Switch",
189191
"loginUserPhoneHintWeb": "With the country code, like +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "The token @BotFather gave you when you created the bot.",
191193
"loginCodeTitleWeb": "Enter the login code",

‎langs/es.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Iniciar sesión en Telegram",
187187
"loginLeadWeb": "Elija la cuenta o el bot con el que se ejecutará esta instancia de MadelineProto.",
188188
"loginTypeWeb": "Iniciar sesión como",
189+
"loginSessionWeb": "Sesión",
190+
"loginSessionSwitchWeb": "Cambiar",
189191
"loginUserPhoneHintWeb": "Con el prefijo del país, por ejemplo +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "El token que le dio @BotFather al crear el bot.",
191193
"loginCodeTitleWeb": "Introduzca el código de inicio de sesión",

‎langs/fa.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "ورود به Telegram",
187187
"loginLeadWeb": "حساب یا رباتی را انتخاب کنید که این نمونه MadelineProto با آن اجرا خواهد شد.",
188188
"loginTypeWeb": "ورود به عنوان",
189+
"loginSessionWeb": "نشست",
190+
"loginSessionSwitchWeb": "تغییر",
189191
"loginUserPhoneHintWeb": "همراه با کد کشور، مانند +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "توکنی که @BotFather هنگام ساخت ربات به شما داد.",
191193
"loginCodeTitleWeb": "کد ورود را وارد کنید",

‎langs/fr.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Connexion à Telegram",
187187
"loginLeadWeb": "Choisissez le compte ou le bot sous lequel cette instance de MadelineProto fonctionnera.",
188188
"loginTypeWeb": "Se connecter en tant que",
189+
"loginSessionWeb": "Session",
190+
"loginSessionSwitchWeb": "Changer",
189191
"loginUserPhoneHintWeb": "Avec l'indicatif du pays, par exemple +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "Le token que @BotFather vous a donné lors de la création du bot.",
191193
"loginCodeTitleWeb": "Entrez le code de connexion",

‎langs/he.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "כניסה ל-Telegram",
187187
"loginLeadWeb": "בחר את החשבון או הבוט שבשמו יפעל מופע MadelineProto הזה.",
188188
"loginTypeWeb": "כניסה בתור",
189+
"loginSessionWeb": "סשן",
190+
"loginSessionSwitchWeb": "החלפה",
189191
"loginUserPhoneHintWeb": "עם קידומת המדינה, למשל +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "הטוקן ש-@BotFather נתן לך כשיצרת את הבוט.",
191193
"loginCodeTitleWeb": "הזן את קוד הכניסה",

‎langs/hi.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Telegram में लॉगिन करें",
187187
"loginLeadWeb": "वह अकाउंट या बॉट चुनें जिसके रूप में यह MadelineProto इंस्टेंस चलेगा।",
188188
"loginTypeWeb": "इस रूप में लॉगिन करें",
189+
"loginSessionWeb": "सत्र",
190+
"loginSessionSwitchWeb": "बदलें",
189191
"loginUserPhoneHintWeb": "देश कोड के साथ, जैसे +39 123 456 7890।",
190192
"loginBotTokenHintWeb": "बॉट बनाते समय @BotFather द्वारा दिया गया टोकन।",
191193
"loginCodeTitleWeb": "लॉगिन कोड दर्ज करें",

‎langs/id.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
"loginTitleWeb": "Login ke Telegram",
187187
"loginLeadWeb": "Pilih akun atau bot yang akan digunakan untuk menjalankan instance MadelineProto ini.",
188188
"loginTypeWeb": "Login sebagai",
189+
"loginSessionWeb": "Sesi",
190+
"loginSessionSwitchWeb": "Ganti",
189191
"loginUserPhoneHintWeb": "Dengan kode negara, misalnya +39 123 456 7890.",
190192
"loginBotTokenHintWeb": "Token yang diberikan @BotFather saat Anda membuat bot.",
191193
"loginCodeTitleWeb": "Masukkan kode login",

0 commit comments

Comments
 (0)