From 0eab78fa8138134301a4887d292f5c2e4c260a34 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 12 Jan 2015 20:29:35 +0000 Subject: Tox: - disabled profile encryption, because it unstable under windows - minor changes in file transfer - updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@11845 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_profile.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'protocols/Tox/src/tox_profile.cpp') diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 4ee3abc526..898899bff1 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -18,11 +18,16 @@ std::tstring CToxProto::GetToxProfilePath(const TCHAR *accountName) bool CToxProto::LoadToxProfile() { std::tstring profilePath = GetToxProfilePath(); + if (!IsFileExists(profilePath)) + { + return true; + } + FILE *profile = _tfopen(profilePath.c_str(), _T("rb")); if (profile == NULL) { debugLogA("CToxProto::LoadToxData: could not open tox profile"); - return true; + return false; } fseek(profile, 0, SEEK_END); @@ -84,7 +89,7 @@ bool CToxProto::LoadToxProfile() void CToxProto::SaveToxProfile() { - size_t size = 0; + /*size_t size = 0; uint8_t *data = NULL; { @@ -107,7 +112,11 @@ void CToxProto::SaveToxProfile() data = (uint8_t*)mir_calloc(size); tox_save(tox, data); } - } + }*/ + + size_t size = tox_size(tox); + uint8_t *data = (uint8_t*)mir_calloc(size); + tox_save(tox, data); std::tstring profilePath = GetToxProfilePath(); FILE *profile = _tfopen(profilePath.c_str(), _T("wb")); -- cgit v1.2.3