1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
Daniel Hrabovcak 2015-05-25 12:20:05 -04:00
commit 399f2c9fef

View File

@ -153,6 +153,10 @@ void Core::make_tox(QByteArray savedata)
toxOptions.proxy_host = nullptr;
toxOptions.proxy_port = 0;
toxOptions.savedata_type = (!savedata.isNull() ? TOX_SAVEDATA_TYPE_TOX_SAVE : TOX_SAVEDATA_TYPE_NONE);
toxOptions.savedata_data = (uint8_t*)savedata.data();
toxOptions.savedata_length = savedata.size();
if (proxyType != ProxyType::ptNone)
{
QString proxyAddr = Settings::getInstance().getProxyAddr();
@ -180,13 +184,13 @@ void Core::make_tox(QByteArray savedata)
}
}
tox = tox_new(&toxOptions, (uint8_t*)savedata.data(), savedata.size(), nullptr);
tox = tox_new(&toxOptions, nullptr);
if (tox == nullptr)
{
if (enableIPv6) // Fallback to IPv4
{
toxOptions.ipv6_enabled = false;
tox = tox_new(&toxOptions, (uint8_t*)savedata.data(), savedata.size(), nullptr);
tox = tox_new(&toxOptions, nullptr);
if (tox == nullptr)
{
if (toxOptions.proxy_type != TOX_PROXY_TYPE_NONE)