2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 23:25:15 +00:00

Allow reference tgcalls implementation.

This commit is contained in:
John Preston
2020-07-30 14:32:37 +04:00
parent c1f727bde9
commit b692242012
5 changed files with 10 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace tgcalls { namespace tgcalls {
class InstanceImpl; class InstanceImpl;
class InstanceImplLegacy; class InstanceImplLegacy;
class InstanceImplReference;
void SetLegacyGlobalServerConfig(const std::string &serverConfig); void SetLegacyGlobalServerConfig(const std::string &serverConfig);
} // namespace tgcalls } // namespace tgcalls
@@ -48,6 +49,7 @@ const auto kDefaultVersion = "2.4.4"_q;
const auto RegisterTag = tgcalls::Register<tgcalls::InstanceImpl>(); const auto RegisterTag = tgcalls::Register<tgcalls::InstanceImpl>();
const auto RegisterTagLegacy = tgcalls::Register<tgcalls::InstanceImplLegacy>(); const auto RegisterTagLegacy = tgcalls::Register<tgcalls::InstanceImplLegacy>();
const auto RegisterTagReference = tgcalls::Register<tgcalls::InstanceImplReference>();
void AppendEndpoint( void AppendEndpoint(
std::vector<tgcalls::Endpoint> &list, std::vector<tgcalls::Endpoint> &list,
@@ -56,7 +58,7 @@ void AppendEndpoint(
if (data.vpeer_tag().v.length() != 16) { if (data.vpeer_tag().v.length() != 16) {
return; return;
} }
auto endpoint = tgcalls::Endpoint{ tgcalls::Endpoint endpoint = {
.endpointId = (int64_t)data.vid().v, .endpointId = (int64_t)data.vid().v,
.host = tgcalls::EndpointHost{ .host = tgcalls::EndpointHost{
.ipv4 = data.vip().v.toStdString(), .ipv4 = data.vip().v.toStdString(),
@@ -654,7 +656,7 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
memcpy(encryptionKeyValue->data(), _authKey.data(), 256); memcpy(encryptionKeyValue->data(), _authKey.data(), 256);
const auto weak = base::make_weak(this); const auto weak = base::make_weak(this);
auto descriptor = tgcalls::Descriptor{ tgcalls::Descriptor descriptor = {
.config = tgcalls::Config{ .config = tgcalls::Config{
.initializationTimeout = serverConfig.callConnectTimeoutMs / 1000., .initializationTimeout = serverConfig.callConnectTimeoutMs / 1000.,
.receiveTimeout = serverConfig.callPacketTimeoutMs / 1000., .receiveTimeout = serverConfig.callPacketTimeoutMs / 1000.,

View File

@@ -79,6 +79,9 @@ PRIVATE
# Linux # Linux
# POSIX # POSIX
reference/InstanceImplReference.cpp
reference/InstanceImplReference.h
) )
target_compile_definitions(lib_tgcalls target_compile_definitions(lib_tgcalls

2
cmake

Submodule cmake updated: d7c7e92ebc...83150a4691