From 2e9a84840853e5e3b94f1ef0158f58abc7b1455e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 18 Apr 2015 17:49:05 +0000 Subject: Tox: fixed call hungup git-svn-id: http://svn.miranda-ng.org/main/trunk@12918 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_multimedia.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 72c746cd27..bc33108e5a 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -323,7 +323,7 @@ void CToxOutgoingAudioCall::OnCancel(CCtrlBase*) if (!isCallStarted) toxav_cancel(m_proto->toxAv, m_proto->calls[hContact], 0, NULL); else - toxav_stop_call(m_proto->toxAv, m_proto->calls[hContact]); + toxav_hangup(m_proto->toxAv, m_proto->calls[hContact]); } INT_PTR CToxProto::OnSendAudioCall(WPARAM hContact, LPARAM) @@ -403,7 +403,7 @@ void CToxProto::OnAvStart(void*, int32_t callId, void *arg) if (friendNumber == TOX_ERROR) { proto->debugLogA(__FUNCTION__": failed to get friend number"); - toxav_stop_call(proto->toxAv, callId); + toxav_hangup(proto->toxAv, callId); return; } @@ -411,7 +411,7 @@ void CToxProto::OnAvStart(void*, int32_t callId, void *arg) if (hContact == NULL) { proto->debugLogA(__FUNCTION__": failed to find contact"); - toxav_stop_call(proto->toxAv, callId); + toxav_hangup(proto->toxAv, callId); return; } @@ -428,7 +428,7 @@ void CToxProto::OnAvStart(void*, int32_t callId, void *arg) if (toxav_prepare_transmission(proto->toxAv, callId, false) == TOX_ERROR) { proto->debugLogA(__FUNCTION__": failed to prepare audio transmition"); - toxav_stop_call(proto->toxAv, callId); + toxav_hangup(proto->toxAv, callId); return; } } @@ -437,11 +437,12 @@ void CToxProto::OnAvEnd(void*, int32_t callId, void *arg) { CToxProto *proto = (CToxProto*)arg; + toxav_kill_transmission(proto->toxAv, callId); + int friendNumber = toxav_get_peer_id(proto->toxAv, callId, 0); if (friendNumber == TOX_ERROR) { proto->debugLogA(__FUNCTION__": failed to get friend number"); - toxav_stop_call(proto->toxAv, callId); return; } @@ -449,7 +450,6 @@ void CToxProto::OnAvEnd(void*, int32_t callId, void *arg) if (hContact == NULL) { proto->debugLogA(__FUNCTION__": failed to find contact"); - toxav_stop_call(proto->toxAv, callId); return; } @@ -460,8 +460,6 @@ void CToxProto::OnAvEnd(void*, int32_t callId, void *arg) db_event_add(hContact, &dbei); WindowList_Broadcast(proto->hAudioDialogs, WM_AUDIO_END, hContact, 0); - - toxav_kill_transmission(proto->toxAv, callId); } void CToxProto::OnAvPeerTimeout(void*, int32_t callId, void *arg) -- cgit v1.2.3