mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +02:00
Show only channel userpic in RTMP livestreams.
This commit is contained in:
parent
18850ebd83
commit
c22d76e5be
1 changed files with 15 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue