diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index 4ff55f9dd..a002623ba 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -651,7 +651,11 @@ void ConnectionCreator::client_loop(ClientInfo &client) { auto r_socket_fd = [&, dc_id = client.dc_id]() -> Result { TRY_RESULT(info, dc_options_set_.find_connection(dc_id, allow_media_only, use_proxy)); stat = info.stat; - int16 raw_dc_id = narrow_cast(info.option->is_media_only() ? -dc_id.get_raw_id() : dc_id.get_raw_id()); + int32 int_dc_id = dc_id.get_raw_id(); + if (G()->is_test_dc()) { + int_dc_id += 10000; + } + int16 raw_dc_id = narrow_cast(info.option->is_media_only() ? -int_dc_id : int_dc_id); if (use_mtproto_proxy) { TRY_RESULT(secret, hex_decode(proxy->secret()));