summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
diff options
context:
space:
mode:
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)