mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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.
|
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;
|
constexpr auto kLimit = 3;
|
||||||
static const auto FillMissingUserpics = [](
|
static const auto FillMissingUserpics = [](
|
||||||
not_null<State*> state,
|
not_null<State*> state,
|
||||||
not_null<Data::GroupCall*> call) {
|
not_null<Data::GroupCall*> call) {
|
||||||
const auto already = int(state->userpics.size());
|
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) {
|
if (already >= kLimit || participants.size() <= already) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::array<const Data::GroupCallParticipant*, kLimit> adding{
|
std::array<const Data::GroupCallParticipant*, kLimit> adding{
|
||||||
{ nullptr }
|
{ nullptr }
|
||||||
};
|
};
|
||||||
for (const auto &participant : call->participants()) {
|
for (const auto &participant : participants) {
|
||||||
const auto alreadyInList = ranges::contains(
|
const auto alreadyInList = ranges::contains(
|
||||||
state->userpics,
|
state->userpics,
|
||||||
participant.peer,
|
participant.peer,
|
||||||
|
@ -186,6 +196,9 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
||||||
int userpicSize) {
|
int userpicSize) {
|
||||||
Expects(state->userpics.size() <= kLimit);
|
Expects(state->userpics.size() <= kLimit);
|
||||||
|
|
||||||
|
if (call->rtmp()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const auto &participants = call->participants();
|
const auto &participants = call->participants();
|
||||||
auto i = begin(state->userpics);
|
auto i = begin(state->userpics);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue