mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Remove streaming channel from live stream "participants".
This commit is contained in:
parent
ad573ecc84
commit
b6395d08d8
1 changed files with 16 additions and 1 deletions
|
@ -70,8 +70,10 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||
std::vector<UserpicInRow> userpics;
|
||||
Ui::GroupCallBarContent current;
|
||||
base::has_weak_ptr guard;
|
||||
uint64 ownerId = 0;
|
||||
bool someUserpicsNotLoaded = false;
|
||||
bool pushScheduled = false;
|
||||
bool noUserpics = false;
|
||||
};
|
||||
|
||||
// speaking DESC, std::max(date, lastActive) DESC
|
||||
|
@ -244,6 +246,8 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||
return [=](auto consumer) {
|
||||
auto lifetime = rpl::lifetime();
|
||||
auto state = lifetime.make_state<State>();
|
||||
state->noUserpics = call->listenersHidden();
|
||||
state->ownerId = call->peer()->id.value;
|
||||
state->current.shown = true;
|
||||
state->current.livestream = call->peer()->isBroadcast();
|
||||
|
||||
|
@ -254,7 +258,18 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||
state->pushScheduled = true;
|
||||
crl::on_main(&state->guard, [=] {
|
||||
state->pushScheduled = false;
|
||||
consumer.put_next_copy(state->current);
|
||||
auto copy = state->current;
|
||||
if (state->noUserpics && copy.count > 0) {
|
||||
const auto i = ranges::find(
|
||||
copy.users,
|
||||
state->ownerId,
|
||||
&Ui::GroupCallUser::id);
|
||||
if (i != end(copy.users)) {
|
||||
copy.users.erase(i);
|
||||
--copy.count;
|
||||
}
|
||||
}
|
||||
consumer.put_next(std::move(copy));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue