mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(groups): add peers if already playing audio when netcam created
This commit is contained in:
parent
7c13b8b7db
commit
e489168775
|
@ -381,11 +381,11 @@ void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
|
||||||
delete peerAudioTimers[peerPk];
|
delete peerAudioTimers[peerPk];
|
||||||
peerAudioTimers[peerPk] = nullptr;
|
peerAudioTimers[peerPk] = nullptr;
|
||||||
});
|
});
|
||||||
}
|
if (netcam) {
|
||||||
if (netcam) {
|
static_cast<GroupNetCamView*>(netcam)->removePeer(peerPk);
|
||||||
static_cast<GroupNetCamView*>(netcam)->removePeer(peerPk);
|
const auto nameIt = group->getPeerList().find(peerPk);
|
||||||
const auto nameIt = group->getPeerList().find(peerPk);
|
static_cast<GroupNetCamView*>(netcam)->addPeer(peerPk, nameIt.value());
|
||||||
static_cast<GroupNetCamView*>(netcam)->addPeer(peerPk, nameIt.value());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
peerLabels[peerPk]->setStyleSheet(Style::getStylesheet(PEER_LABEL_STYLE_SHEET_PATH));
|
peerLabels[peerPk]->setStyleSheet(Style::getStylesheet(PEER_LABEL_STYLE_SHEET_PATH));
|
||||||
|
@ -466,8 +466,17 @@ void GroupChatForm::onCallClicked()
|
||||||
|
|
||||||
GenericNetCamView* GroupChatForm::createNetcam()
|
GenericNetCamView* GroupChatForm::createNetcam()
|
||||||
{
|
{
|
||||||
// leave view empty, it will pe populated once we receive audio from peers
|
auto view = new GroupNetCamView(group->getId(), this);
|
||||||
return new GroupNetCamView(group->getId(), this);
|
|
||||||
|
const auto& names = group->getPeerList();
|
||||||
|
const auto ownPk = Core::getInstance()->getSelfPublicKey();
|
||||||
|
for (const auto& peerPk : names.keys()) {
|
||||||
|
auto timerIt = peerAudioTimers.find(peerPk);
|
||||||
|
if (peerPk != ownPk && timerIt != peerAudioTimers.end()) {
|
||||||
|
static_cast<GroupNetCamView*>(view)->addPeer(peerPk, names.find(peerPk).value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupChatForm::keyPressEvent(QKeyEvent* ev)
|
void GroupChatForm::keyPressEvent(QKeyEvent* ev)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user