summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-14 19:56:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-14 19:56:42 +0000
commit29fcbd4c970c7b2aba1539519b8ec68f0370a1e2 (patch)
treeed4139f9b0ab7eb9d41ae2416a5cfd562ccea22f /protocols/Tox/src/tox_events.cpp
parent14001c799e72b8eefa523f8ff7ce44c443c78db8 (diff)
Tox: more point to save tox data
git-svn-id: http://svn.miranda-ng.org/main/trunk@10184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r--protocols/Tox/src/tox_events.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp
index 8283e80c6a..d10e146aee 100644
--- a/protocols/Tox/src/tox_events.cpp
+++ b/protocols/Tox/src/tox_events.cpp
@@ -49,13 +49,15 @@ INT_PTR CToxProto::OnContactDeleted(WPARAM wParam, LPARAM)
std::vector<uint8_t> clientId = HexStringToData(toxId);
uint32_t number = tox_get_friend_number(tox, clientId.data());
- if (tox_del_friend(tox, number) == -1)
+ if (tox_del_friend(tox, number) == 0)
{
- return 1;
+ SaveToxData();
+
+ return 0;
}
}
- return 0;
+ return 1;
}
void CToxProto::OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *message, const uint16_t messageSize, void *arg)
@@ -66,6 +68,8 @@ void CToxProto::OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *
std::string toxId = proto->DataToHexString(clientId);
proto->RaiseAuthRequestEvent(time(NULL), toxId.c_str(), (char*)message);
+
+ proto->SaveToxData();
}
void CToxProto::OnFriendMessage(Tox *tox, const int friendnumber, const uint8_t *message, const uint16_t messageSize, void *arg)