summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-14 20:32:40 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-14 20:32:40 +0000
commit4d0735ab834be6c541e7e577fbe76c888bf4d09f (patch)
tree8e290ade50e86e7b5f53a2b66bb0f1f2a2119982 /protocols/Tox/src/tox_contacts.cpp
parent31ba819bd0994a0a48a174cba37b5985522ff3f8 (diff)
Tox: second approach for audio support
git-svn-id: http://svn.miranda-ng.org/main/trunk@12827 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r--protocols/Tox/src/tox_contacts.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index f5d72f8efc..3afc60f0bb 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -216,6 +216,36 @@ INT_PTR CToxProto::OnGrantAuth(WPARAM hContact, LPARAM)
return 0;
}
+int CToxProto::OnContactDeleted(MCONTACT hContact, LPARAM)
+{
+ if (!IsOnline())
+ {
+ return -1;
+ }
+
+ if (!isChatRoom(hContact))
+ {
+ int32_t friendNumber = GetToxFriendNumber(hContact);
+ TOX_ERR_FRIEND_DELETE error;
+ if (!tox_friend_delete(tox, friendNumber, &error))
+ {
+ debugLogA(__FUNCTION__": failed to delete friend (%d)", error);
+ return error;
+ }
+ }
+ /*else
+ {
+ OnLeaveChatRoom(hContact, 0);
+ int groupNumber = 0; // ???
+ if (groupNumber == TOX_ERROR || tox_del_groupchat(tox, groupNumber) == TOX_ERROR)
+ {
+ return 1;
+ }
+ }*/
+
+ return 0;
+}
+
void CToxProto::OnFriendRequest(Tox*, const uint8_t *pubKey, const uint8_t *message, size_t length, void *arg)
{
CToxProto *proto = (CToxProto*)arg;