|
|
@ -224,6 +224,11 @@ void GroupChatForm::updateUserNames() |
|
|
|
|
|
|
|
|
|
|
|
peerLabels.clear(); |
|
|
|
peerLabels.clear(); |
|
|
|
const int peersCount = group->getPeersCount(); |
|
|
|
const int peersCount = group->getPeersCount(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// no need to do anything without a peer
|
|
|
|
|
|
|
|
if (peersCount == 0) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
peerLabels.reserve(peersCount); |
|
|
|
peerLabels.reserve(peersCount); |
|
|
|
QVector<QLabel*> nickLabelList(peersCount); |
|
|
|
QVector<QLabel*> nickLabelList(peersCount); |
|
|
|
|
|
|
|
|
|
|
@ -245,9 +250,9 @@ void GroupChatForm::updateUserNames() |
|
|
|
|
|
|
|
|
|
|
|
if (group->isSelfPeerNumber(peerNumber)) { |
|
|
|
if (group->isSelfPeerNumber(peerNumber)) { |
|
|
|
label->setStyleSheet(QStringLiteral("QLabel {color : green;}")); |
|
|
|
label->setStyleSheet(QStringLiteral("QLabel {color : green;}")); |
|
|
|
} else if (s.getBlackList().contains(peerPk.toString())) { |
|
|
|
} else if (s.getBlackList().contains(peerPk.toString())) { |
|
|
|
label->setStyleSheet(QStringLiteral("QLabel {color : darkRed;}")); |
|
|
|
label->setStyleSheet(QStringLiteral("QLabel {color : darkRed;}")); |
|
|
|
} else if (netcam != nullptr) { |
|
|
|
} else if (netcam != nullptr) { |
|
|
|
static_cast<GroupNetCamView*>(netcam)->addPeer(peerNumber, fullName); |
|
|
|
static_cast<GroupNetCamView*>(netcam)->addPeer(peerNumber, fullName); |
|
|
|
} |
|
|
|
} |
|
|
|
peerLabels.append(label); |
|
|
|
peerLabels.append(label); |
|
|
@ -262,6 +267,7 @@ void GroupChatForm::updateUserNames() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return a->text().toLower() < b->text().toLower(); |
|
|
|
return a->text().toLower() < b->text().toLower(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// remove comma from last sorted label
|
|
|
|
// remove comma from last sorted label
|
|
|
|
QLabel* const lastLabel = nickLabelList.last(); |
|
|
|
QLabel* const lastLabel = nickLabelList.last(); |
|
|
|
QString labelText = lastLabel->text(); |
|
|
|
QString labelText = lastLabel->text(); |
|
|
|