diff options
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);
|