1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(groups): don't add peers to netcam view until they play audio

Fix #5536
This commit is contained in:
Anthony Bilinski 2019-03-04 23:15:36 -08:00
parent 86415cb71c
commit 7c13b8b7db
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -278,8 +278,6 @@ void GroupChatForm::updateUserNames()
label->setProperty("peerType", LABEL_PEER_TYPE_OUR);
} else if (s.getBlackList().contains(peerPk.toString())) {
label->setProperty("peerType", LABEL_PEER_TYPE_MUTED);
} else if (netcam != nullptr) {
static_cast<GroupNetCamView*>(netcam)->addPeer(peerPk, fullName);
}
label->setStyleSheet(Style::getStylesheet(PEER_LABEL_STYLE_SHEET_PATH));
@ -383,12 +381,11 @@ 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());
}
}
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));