Hang Up when close chat window.

This commit is contained in:
Phenom 2015-10-10 18:47:07 +02:00
parent 1989f366a7
commit 3deee001d4

View File

@ -315,6 +315,8 @@ VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget, VOIPNotify *n
VOIPChatWidgetHolder::~VOIPChatWidgetHolder() VOIPChatWidgetHolder::~VOIPChatWidgetHolder()
{ {
hangupCall();
if(inputAudioDevice != NULL) if(inputAudioDevice != NULL)
inputAudioDevice->stop() ; inputAudioDevice->stop() ;
@ -492,7 +494,7 @@ void VOIPChatWidgetHolder::hangupCallAudio()
atLeastOneChecked = true; atLeastOneChecked = true;
} }
if (!atLeastOneChecked) { if (!atLeastOneChecked) {
//Decline button or Friend hang up //Decline button ,Friend hang up or chat close
if (recAudioRingTime != -1) { if (recAudioRingTime != -1) {
rsVOIP->sendVoipHangUpCall(mChatWidget->getChatId().toPeerId(), RS_VOIP_FLAGS_AUDIO_DATA); rsVOIP->sendVoipHangUpCall(mChatWidget->getChatId().toPeerId(), RS_VOIP_FLAGS_AUDIO_DATA);
deleteButtonMap(RS_VOIP_FLAGS_AUDIO_DATA); deleteButtonMap(RS_VOIP_FLAGS_AUDIO_DATA);
@ -521,7 +523,7 @@ void VOIPChatWidgetHolder::hangupCallVideo()
atLeastOneChecked = true; atLeastOneChecked = true;
} }
if (!atLeastOneChecked) { if (!atLeastOneChecked) {
//Decline button or Friend hang up //Decline button ,Friend hang up or chat close
if (recVideoRingTime != -1) { if (recVideoRingTime != -1) {
rsVOIP->sendVoipHangUpCall(mChatWidget->getChatId().toPeerId(), RS_VOIP_FLAGS_VIDEO_DATA); rsVOIP->sendVoipHangUpCall(mChatWidget->getChatId().toPeerId(), RS_VOIP_FLAGS_VIDEO_DATA);
deleteButtonMap(RS_VOIP_FLAGS_VIDEO_DATA); deleteButtonMap(RS_VOIP_FLAGS_VIDEO_DATA);