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,12 +381,12 @@ void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
|
|||
delete peerAudioTimers[peerPk];
|
||||
peerAudioTimers[peerPk] = nullptr;
|
||||
});
|
||||
}
|
||||
if (netcam) {
|
||||
static_cast<GroupNetCamView*>(netcam)->removePeer(peerPk);
|
||||
const auto nameIt = group->getPeerList().find(peerPk);
|
||||
static_cast<GroupNetCamView*>(netcam)->addPeer(peerPk, nameIt.value());
|
||||
}
|
||||
}
|
||||
|
||||
peerLabels[peerPk]->setStyleSheet(Style::getStylesheet(PEER_LABEL_STYLE_SHEET_PATH));
|
||||
peerAudioTimers[peerPk]->start(500);
|
||||
|
@ -466,8 +466,17 @@ void GroupChatForm::onCallClicked()
|
|||
|
||||
GenericNetCamView* GroupChatForm::createNetcam()
|
||||
{
|
||||
// leave view empty, it will pe populated once we receive audio from peers
|
||||
return new GroupNetCamView(group->getId(), this);
|
||||
auto view = 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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user