diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-02-17 06:43:34 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-02-17 06:43:34 +0000 |
commit | 697c3a9ab13f212655a713c60e2be895b02334da (patch) | |
tree | c53edb23cb360855c178189ca30a9c5b3e9a1462 /protocols | |
parent | 1016c8797411060d61304a40f506457966ff35b3 (diff) |
Tox:
- fixed (strange hack) profile loading
- reverted frend list loading on login
git-svn-id: http://svn.miranda-ng.org/main/trunk@12157 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 3 | ||||
-rw-r--r-- | protocols/Tox/src/tox_profile.cpp | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 7d3eb4c5a2..71ec195ccb 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -48,6 +48,9 @@ void CToxProto::TryConnect() {
isConnected = true;
debugLogA("CToxProto::PollingThread: successfuly connected to DHT");
+
+ ForkThread(&CToxProto::LoadFriendList, NULL);
+
m_iStatus = m_iDesiredStatus;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus);
tox_set_user_status(tox, MirandaToToxStatus(m_iStatus));
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 9bb69f6289..f5a35c6629 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -31,7 +31,7 @@ bool CToxProto::LoadToxProfile() }
fseek(profile, 0, SEEK_END);
- long size = ftell(profile);
+ size_t size = ftell(profile);
rewind(profile);
if (size == 0)
{
@@ -41,7 +41,7 @@ bool CToxProto::LoadToxProfile() }
uint8_t *data = (uint8_t*)mir_calloc(size);
- if (fread((char*)data, sizeof(char), size, profile) != (size_t)size)
+ if (fread((char*)data, sizeof(char), size, profile) != size)
{
fclose(profile);
debugLogA("CToxProto::LoadToxData: could not read tox profile");
@@ -74,7 +74,8 @@ bool CToxProto::LoadToxProfile() }
else
{
- if (tox_load(tox, data, size) == TOX_ERROR)
+ // it return -1 but load, wtf?
+ if (tox_load(tox, data, size) > 0)
{
debugLogA("CToxProto::LoadToxData: could not load tox profile");
mir_free(data);
|