summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_profile.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-01-12 20:29:35 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-01-12 20:29:35 +0000
commit0eab78fa8138134301a4887d292f5c2e4c260a34 (patch)
treee4d429a79c10d15840a230ce66cf550c3d1dd6b6 /protocols/Tox/src/tox_profile.cpp
parentd29a4479c7b502dd728af326511b26bc0f821542 (diff)
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
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r--protocols/Tox/src/tox_profile.cpp15
1 files changed, 12 insertions, 3 deletions
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"));