mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Debug feature added for overriding dc options.
Now you can type "endpoints" in Settings and choose a file with a complete set of dc_options that will be used instead of built-in or received through mtproto config till the end of current session.
This commit is contained in:
@@ -35,6 +35,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "boxes/confirmbox.h"
|
||||
#include "lang.h"
|
||||
#include "messenger.h"
|
||||
#include "mtproto/mtp_instance.h"
|
||||
#include "mtproto/dc_options.h"
|
||||
#include "core/file_utilities.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "window/themes/window_theme_editor.h"
|
||||
@@ -110,6 +112,15 @@ void fillCodes() {
|
||||
Ui::hideLayer();
|
||||
}));
|
||||
});
|
||||
Codes.insert(qsl("endpoints"), []() {
|
||||
FileDialog::GetOpenPath("Open DC endpoints", "DC Endpoints (*.tdesktop-endpoints)", [](const FileDialog::OpenResult &result) {
|
||||
if (!result.paths.isEmpty()) {
|
||||
if (!Messenger::Instance().mtp()->dcOptions()->loadFromFile(result.paths.front())) {
|
||||
Ui::show(Box<InformBox>("Could not load endpoints :( Errors in 'log.txt'."));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void codesFeedString(const QString &text) {
|
||||
|
Reference in New Issue
Block a user