diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-12 19:54:22 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-12 19:54:22 +0000 |
commit | 2e2390295cbf3f8f24a938bf957d3ecd5b86d3a6 (patch) | |
tree | c0282edc1d21e3056dfc86077fa7503524b9b366 /protocols/Tox/src/tox_events.cpp | |
parent | 442fbaf1d2df12c1f359b0ab64ddcecaff250628 (diff) |
Tox: contact deletion
git-svn-id: http://svn.miranda-ng.org/main/trunk@10172 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r-- | protocols/Tox/src/tox_events.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp index ebc189aeba..6007530666 100644 --- a/protocols/Tox/src/tox_events.cpp +++ b/protocols/Tox/src/tox_events.cpp @@ -40,6 +40,24 @@ int CToxProto::OnOptionsInit(void *obj, WPARAM wParam, LPARAM lParam) return 0;
}
+INT_PTR CToxProto::OnContactDeleted(WPARAM wParam, LPARAM)
+{
+ MCONTACT hContact = (MCONTACT)wParam;
+ if (hContact)
+ {
+ std::string toxId(getStringA(hContact, TOX_SETTING_ID));
+ std::vector<uint8_t> clientId = HexStringToData(toxId);
+
+ uint32_t number = tox_get_friend_number(tox, clientId.data());
+ if (tox_del_friend(tox, number) == -1)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
void CToxProto::OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *message, const uint16_t messageSize, void *arg)
{
CToxProto *proto = (CToxProto*)arg;
|