Show only channel userpic in RTMP livestreams.

This commit is contained in:
John Preston 2025-01-21 11:25:37 +04:00
parent 18850ebd83
commit c22d76e5be

View file

@ -85,19 +85,29 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
return (~uint64(0)) - result; // sorting with less(), so invert.
};
static const auto RtmpCallTopBarParticipants = [](
not_null<Data::GroupCall*> call) {
using Participant = Data::GroupCallParticipant;
return std::vector<Participant>{ Participant{
.peer = call->peer(),
} };
};
constexpr auto kLimit = 3;
static const auto FillMissingUserpics = [](
not_null<State*> state,
not_null<Data::GroupCall*> call) {
const auto already = int(state->userpics.size());
const auto &participants = call->participants();
const auto &participants = call->rtmp()
? RtmpCallTopBarParticipants(call)
: call->participants();
if (already >= kLimit || participants.size() <= already) {
return false;
}
std::array<const Data::GroupCallParticipant*, kLimit> adding{
{ nullptr }
};
for (const auto &participant : call->participants()) {
for (const auto &participant : participants) {
const auto alreadyInList = ranges::contains(
state->userpics,
participant.peer,
@ -186,6 +196,9 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
int userpicSize) {
Expects(state->userpics.size() <= kLimit);
if (call->rtmp()) {
return false;
}
const auto &participants = call->participants();
auto i = begin(state->userpics);