mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 16:05:57 +00:00
Show only channel userpic in RTMP livestreams.
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user