2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Updated TDesktop sources to 3.2.5

This commit is contained in:
RadRussianRus
2021-12-07 09:25:44 +03:00
556 changed files with 18784 additions and 8391 deletions

View File

@@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
#include "main/main_account.h"
#include "main/main_domain.h"
#include "boxes/confirm_box.h"
#include "ui/boxes/confirm_box.h"
#include "boxes/add_contact_box.h"
#include "lang/lang_cloud_manager.h"
#include "lang/lang_instance.h"
@@ -32,6 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "media/audio/media_audio_track.h"
#include "settings/settings_common.h"
#include "api/api_updates.h"
#include "base/qt_adapters.h"
#include "zlib.h"
@@ -78,7 +79,7 @@ auto GenerateCodes() {
? qsl("Do you want to disable DEBUG logs?")
: qsl("Do you want to enable DEBUG logs?\n\n"
"All network events will be logged.");
Ui::show(Box<ConfirmBox>(text, [] {
Ui::show(Box<Ui::ConfirmBox>(text, [] {
Core::App().switchDebugMode();
}));
});
@@ -98,7 +99,7 @@ auto GenerateCodes() {
});
codes.emplace(qsl("moderate"), [](SessionController *window) {
auto text = Core::App().settings().moderateModeEnabled() ? qsl("Disable moderate mode?") : qsl("Enable moderate mode?");
Ui::show(Box<ConfirmBox>(text, [=] {
Ui::show(Box<Ui::ConfirmBox>(text, [=] {
Core::App().settings().setModerateModeEnabled(!Core::App().settings().moderateModeEnabled());
Core::App().saveSettingsDelayed();
Ui::hideLayer();
@@ -127,7 +128,8 @@ auto GenerateCodes() {
if (!result.paths.isEmpty()) {
const auto loadFor = [&](not_null<Main::Account*> account) {
if (!account->mtp().dcOptions().loadFromFile(result.paths.front())) {
Ui::show(Box<InformBox>("Could not load endpoints :( Errors in 'log.txt'."));
Ui::show(Box<Ui::InformBox>("Could not load endpoints"
" :( Errors in 'log.txt'."));
}
};
if (const auto strong = weak.get()) {
@@ -176,7 +178,7 @@ auto GenerateCodes() {
#endif // !Q_OS_WIN
: qsl("Switch font engine to FreeType?");
Ui::show(Box<ConfirmBox>(text, [] {
Ui::show(Box<Ui::ConfirmBox>(text, [] {
Core::App().switchFreeType();
}));
});
@@ -205,7 +207,7 @@ auto GenerateCodes() {
auto track = Media::Audio::Current().createTrack();
track->fillFromFile(result.paths.front());
if (track->failed()) {
Ui::show(Box<InformBox>(
Ui::show(Box<Ui::InformBox>(
"Could not audio :( Errors in 'log.txt'."));
} else {
Core::App().settings().setSoundOverride(
@@ -220,7 +222,7 @@ auto GenerateCodes() {
codes.emplace(qsl("sounds_reset"), [](SessionController *window) {
Core::App().settings().clearSoundOverrides();
Core::App().saveSettingsDelayed();
Ui::show(Box<InformBox>("All sound overrides were reset."));
Ui::show(Box<Ui::InformBox>("All sound overrides were reset."));
});
codes.emplace(qsl("unpacklog"), [](SessionController *window) {
FileDialog::GetOpenPath(Core::App().getFileDialogParent(), "Open crash log file", "Crash dump (*.txt)", [=](const FileDialog::OpenResult &result) {
@@ -297,7 +299,7 @@ void CodesFeedString(SessionController *window, const QString &text) {
secret += text.toLower();
int size = secret.size(), from = 0;
while (size > from) {
auto piece = secret.midRef(from);
auto piece = base::StringViewMid(secret,from);
auto found = false;
for (const auto &[key, method] : codes) {
if (piece == key) {