mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix #600
This commit is contained in:
parent
77edbb668e
commit
a908e036ce
|
@ -186,6 +186,7 @@ signals:
|
|||
void avPeerTimeout(int friendId, int callIndex);
|
||||
void avMediaChange(int friendId, int callIndex, bool videoEnabled);
|
||||
void avCallFailed(int friendId);
|
||||
void avRejected(int friendId, int callIndex);
|
||||
|
||||
void videoFrameReceived(vpx_image* frame);
|
||||
|
||||
|
|
|
@ -324,9 +324,19 @@ void Core::onAvCancel(void* _toxav, int32_t callId, void* core)
|
|||
emit static_cast<Core*>(core)->avCancel(friendId, callId);
|
||||
}
|
||||
|
||||
void Core::onAvReject(void*, int32_t, void*)
|
||||
void Core::onAvReject(void* _toxav, int32_t callId, void* core)
|
||||
{
|
||||
qDebug() << "Core: AV reject";
|
||||
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
||||
int friendId = toxav_get_peer_id(toxav, callId, 0);
|
||||
if (friendId < 0)
|
||||
{
|
||||
qWarning() << "Core: Received invalid AV reject";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << QString("Core: AV reject from %1").arg(friendId);
|
||||
|
||||
emit static_cast<Core*>(core)->avRejected(friendId, callId);
|
||||
}
|
||||
|
||||
void Core::onAvEnd(void* _toxav, int32_t call_index, void* core)
|
||||
|
|
|
@ -434,6 +434,31 @@ void ChatForm::onAvPeerTimeout(int FriendId, int)
|
|||
netcam->hide();
|
||||
}
|
||||
|
||||
void ChatForm::onAvRejected(int FriendId, int)
|
||||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
|
||||
audioInputFlag = false;
|
||||
audioOutputFlag = false;
|
||||
micButton->setObjectName("green");
|
||||
micButton->style()->polish(micButton);
|
||||
volButton->setObjectName("green");
|
||||
volButton->style()->polish(volButton);
|
||||
callButton->disconnect();
|
||||
videoButton->disconnect();
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
videoButton->setObjectName("green");
|
||||
videoButton->style()->polish(videoButton);
|
||||
videoButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered()));
|
||||
|
||||
netcam->hide();
|
||||
}
|
||||
|
||||
void ChatForm::onAvMediaChange(int FriendId, int CallId, bool video)
|
||||
{
|
||||
if (FriendId != f->friendId || CallId != callId)
|
||||
|
|
|
@ -57,6 +57,7 @@ public slots:
|
|||
void onAvPeerTimeout(int FriendId, int CallId);
|
||||
void onAvMediaChange(int FriendId, int CallId, bool video);
|
||||
void onAvCallFailed(int FriendId);
|
||||
void onAvRejected(int FriendId, int CallId);
|
||||
void onMicMuteToggle();
|
||||
void onVolMuteToggle();
|
||||
void onAvatarChange(int FriendId, const QPixmap& pic);
|
||||
|
|
|
@ -623,6 +623,7 @@ void Widget::addFriend(int friendId, const QString &userId)
|
|||
connect(core, &Core::avPeerTimeout, newfriend->chatForm, &ChatForm::onAvPeerTimeout);
|
||||
connect(core, &Core::avMediaChange, newfriend->chatForm, &ChatForm::onAvMediaChange);
|
||||
connect(core, &Core::avCallFailed, newfriend->chatForm, &ChatForm::onAvCallFailed);
|
||||
connect(core, &Core::avRejected, newfriend->chatForm, &ChatForm::onAvRejected);
|
||||
connect(core, &Core::friendAvatarChanged, newfriend->chatForm, &ChatForm::onAvatarChange);
|
||||
connect(core, &Core::friendAvatarChanged, newfriend->widget, &FriendWidget::onAvatarChange);
|
||||
connect(core, &Core::friendAvatarRemoved, newfriend->chatForm, &ChatForm::onAvatarRemoved);
|
||||
|
|
Loading…
Reference in New Issue
Block a user