From c22d76e5be193aa530bd214942adf30655d0de5f Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 21 Jan 2025 11:25:37 +0400 Subject: [PATCH] Show only channel userpic in RTMP livestreams. --- .../view/history_view_group_call_bar.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp b/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp index c460ab1e0..68d952d86 100644 --- a/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp @@ -85,19 +85,29 @@ rpl::producer GroupCallBarContentByCall( return (~uint64(0)) - result; // sorting with less(), so invert. }; + static const auto RtmpCallTopBarParticipants = []( + not_null call) { + using Participant = Data::GroupCallParticipant; + return std::vector{ Participant{ + .peer = call->peer(), + } }; + }; + constexpr auto kLimit = 3; static const auto FillMissingUserpics = []( not_null state, not_null 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 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 GroupCallBarContentByCall( int userpicSize) { Expects(state->userpics.size() <= kLimit); + if (call->rtmp()) { + return false; + } const auto &participants = call->participants(); auto i = begin(state->userpics);