mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +00:00
Updated TDesktop sources to 3.2.5
This commit is contained in:
@@ -10,8 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "kotato/kotato_lang.h"
|
||||
#include "base/bytes.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "boxes/confirm_phone_box.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "base/unixtime.h"
|
||||
#include "mainwindow.h"
|
||||
#include "apiwrap.h"
|
||||
@@ -25,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/sent_code_field.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "passport/passport_encryption.h"
|
||||
@@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_passport.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "base/qt_adapters.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -108,7 +109,7 @@ void StartPendingReset(
|
||||
auto finish = [=](const QString &message) mutable {
|
||||
if (const auto strong = weak.data()) {
|
||||
if (!message.isEmpty()) {
|
||||
strong->getDelegate()->show(Box<InformBox>(message));
|
||||
strong->getDelegate()->show(Box<Ui::InformBox>(message));
|
||||
}
|
||||
strong->closeBox();
|
||||
}
|
||||
@@ -139,7 +140,7 @@ void StartPendingReset(
|
||||
lt_count,
|
||||
minutes);
|
||||
if (const auto strong = weak.data()) {
|
||||
strong->getDelegate()->show(Box<InformBox>(
|
||||
strong->getDelegate()->show(Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_reset_later(
|
||||
tr::now,
|
||||
lt_duration,
|
||||
@@ -441,7 +442,7 @@ void PasscodeBox::recoverPasswordDone(
|
||||
if (weak) {
|
||||
_newPasswordSet.fire_copy(newPasswordBytes);
|
||||
if (weak) {
|
||||
getDelegate()->show(Box<InformBox>(
|
||||
getDelegate()->show(Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_updated(tr::now)));
|
||||
if (weak) {
|
||||
closeBox();
|
||||
@@ -463,7 +464,7 @@ void PasscodeBox::setPasswordDone(const QByteArray &newPasswordBytes) {
|
||||
: _oldPasscode->isHidden()
|
||||
? tr::lng_cloud_password_was_set(tr::now)
|
||||
: tr::lng_cloud_password_updated(tr::now);
|
||||
getDelegate()->show(Box<InformBox>(text));
|
||||
getDelegate()->show(Box<Ui::InformBox>(text));
|
||||
if (weak) {
|
||||
closeBox();
|
||||
}
|
||||
@@ -526,7 +527,7 @@ void PasscodeBox::setPasswordFail(
|
||||
const MTP::Error &error) {
|
||||
const auto prefix = qstr("EMAIL_UNCONFIRMED_");
|
||||
if (error.type().startsWith(prefix)) {
|
||||
const auto codeLength = error.type().midRef(prefix.size()).toInt();
|
||||
const auto codeLength = base::StringViewMid(error.type(), prefix.size()).toInt();
|
||||
|
||||
closeReplacedBy();
|
||||
_setRequest = 0;
|
||||
@@ -563,7 +564,7 @@ void PasscodeBox::validateEmail(
|
||||
const auto weak = Ui::MakeWeak(this);
|
||||
_clearUnconfirmedPassword.fire({});
|
||||
if (weak) {
|
||||
auto box = Box<InformBox>(
|
||||
auto box = Box<Ui::InformBox>(
|
||||
Lang::Hard::EmailConfirmationExpired());
|
||||
weak->getDelegate()->show(
|
||||
std::move(box),
|
||||
@@ -690,7 +691,7 @@ void PasscodeBox::save(bool force) {
|
||||
if (!onlyCheck && !_recoverEmail->isHidden() && email.isEmpty() && !force) {
|
||||
_skipEmailWarning = true;
|
||||
_replacedBy = getDelegate()->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_about_recover(tr::now),
|
||||
tr::lng_cloud_password_skip_email(tr::now),
|
||||
st::attentionBoxButton,
|
||||
@@ -727,7 +728,7 @@ void PasscodeBox::submitOnlyCheckCloudPassword(const QString &oldPassword) {
|
||||
send();
|
||||
close();
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_passport_losing(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
confirmed));
|
||||
@@ -798,7 +799,7 @@ void PasscodeBox::requestPasswordData() {
|
||||
}
|
||||
|
||||
void PasscodeBox::serverError() {
|
||||
getDelegate()->show(Box<InformBox>(Lang::Hard::ServerError()));
|
||||
getDelegate()->show(Box<Ui::InformBox>(Lang::Hard::ServerError()));
|
||||
closeBox();
|
||||
}
|
||||
|
||||
@@ -953,7 +954,7 @@ void PasscodeBox::suggestSecretReset(const QString &newPassword) {
|
||||
resetSecret(check, newPassword, std::move(close));
|
||||
});
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
Lang::Hard::PassportCorruptedChange(),
|
||||
Lang::Hard::PassportCorruptedReset(),
|
||||
std::move(resetSecretAndSave)));
|
||||
@@ -1086,7 +1087,7 @@ void PasscodeBox::recoverByEmail() {
|
||||
}
|
||||
});
|
||||
});
|
||||
*confirmBox = getDelegate()->show(Box<ConfirmBox>(
|
||||
*confirmBox = getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_reset_no_email(tr::now),
|
||||
tr::lng_cloud_password_reset_ok(tr::now),
|
||||
reset));
|
||||
@@ -1171,7 +1172,7 @@ RecoverBox::RecoverBox(
|
||||
}
|
||||
});
|
||||
});
|
||||
*confirmBox = getDelegate()->show(Box<ConfirmBox>(
|
||||
*confirmBox = getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_reset_with_email(tr::now),
|
||||
tr::lng_cloud_password_reset_ok(tr::now),
|
||||
reset));
|
||||
@@ -1273,7 +1274,7 @@ void RecoverBox::submit() {
|
||||
send();
|
||||
close();
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_passport_losing(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
confirmed));
|
||||
@@ -1298,7 +1299,7 @@ void RecoverBox::proceedToClear() {
|
||||
_submitRequest = 0;
|
||||
_newPasswordSet.fire({});
|
||||
getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
}
|
||||
|
||||
@@ -1346,7 +1347,7 @@ void RecoverBox::checkSubmitFail(const MTP::Error &error) {
|
||||
if (err == qstr("PASSWORD_EMPTY")) {
|
||||
_newPasswordSet.fire(QByteArray());
|
||||
getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
|
||||
closeBox();
|
||||
@@ -1387,7 +1388,8 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
|
||||
reloads->fire({});
|
||||
if (*weak) {
|
||||
(*weak)->getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_was_set(tr::now)),
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_was_set(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
}
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
@@ -1399,7 +1401,7 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
|
||||
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
||||
cancels->fire({});
|
||||
if (*weak) {
|
||||
auto box = Box<InformBox>(
|
||||
auto box = Box<Ui::InformBox>(
|
||||
Lang::Hard::EmailConfirmationExpired());
|
||||
(*weak)->getDelegate()->show(
|
||||
std::move(box),
|
||||
|
Reference in New Issue
Block a user