diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-01 18:05:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-01 18:05:00 +0300 |
commit | c4a542557cb47af428d1397b97f652a65cffd6c6 (patch) | |
tree | 4ad0b5e31d57f9dce5a26e96721e2a5638a87ebe /protocols/Telegram/src/auth.cpp | |
parent | f828d2569303fa4b26bee503dc9f438fd1fe0c7d (diff) |
fixes #3286 (Telegram: ability to identify Miranda's session)
Diffstat (limited to 'protocols/Telegram/src/auth.cpp')
-rw-r--r-- | protocols/Telegram/src/auth.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/protocols/Telegram/src/auth.cpp b/protocols/Telegram/src/auth.cpp index c29053af18..9591f5fc98 100644 --- a/protocols/Telegram/src/auth.cpp +++ b/protocols/Telegram/src/auth.cpp @@ -17,6 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" +#include "../../../../miranda-private-keys/Telegram/api.h" + /////////////////////////////////////////////////////////////////////////////// INT_PTR CALLBACK CMTProto::EnterPhoneCode(void *param) @@ -61,8 +63,10 @@ void CMTProto::ProcessAuth(TD::updateAuthorizationState *pObj) switch (pAuthState->get_id()) { case TD::authorizationStateWaitTdlibParameters::ID: { + MFileVersion v; char text[100]; - Miranda_GetVersionText(text, sizeof(text)); + Miranda_GetFileVersion(&v); + mir_snprintf(text, "%d.%d.%d.%d", v[0], v[1], v[2], v[3]); CMStringW wszPath(GetProtoFolder()); @@ -70,10 +74,10 @@ void CMTProto::ProcessAuth(TD::updateAuthorizationState *pObj) request->database_directory_ = T2Utf(wszPath).get(); request->use_message_database_ = false; request->use_secret_chats_ = true; - request->api_id_ = 94575; - request->api_hash_ = "a3406de8d171bb422bb6ddf3bbd800e2"; + request->api_id_ = MIRANDA_API_ID; + request->api_hash_ = MIRANDA_API_HASH; request->system_language_code_ = "en"; - request->device_model_ = "Miranda NG"; + request->device_model_ = T2Utf(m_wszDeviceName).get(); request->application_version_ = text; request->enable_storage_optimizer_ = true; SendQuery(request, &CMTProto::OnUpdateAuth); |