mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 00:25:17 +00:00
Remove streaming channel from live stream "participants".
This commit is contained in:
@@ -70,8 +70,10 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||||||
std::vector<UserpicInRow> userpics;
|
std::vector<UserpicInRow> userpics;
|
||||||
Ui::GroupCallBarContent current;
|
Ui::GroupCallBarContent current;
|
||||||
base::has_weak_ptr guard;
|
base::has_weak_ptr guard;
|
||||||
|
uint64 ownerId = 0;
|
||||||
bool someUserpicsNotLoaded = false;
|
bool someUserpicsNotLoaded = false;
|
||||||
bool pushScheduled = false;
|
bool pushScheduled = false;
|
||||||
|
bool noUserpics = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// speaking DESC, std::max(date, lastActive) DESC
|
// speaking DESC, std::max(date, lastActive) DESC
|
||||||
@@ -244,6 +246,8 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||||||
return [=](auto consumer) {
|
return [=](auto consumer) {
|
||||||
auto lifetime = rpl::lifetime();
|
auto lifetime = rpl::lifetime();
|
||||||
auto state = lifetime.make_state<State>();
|
auto state = lifetime.make_state<State>();
|
||||||
|
state->noUserpics = call->listenersHidden();
|
||||||
|
state->ownerId = call->peer()->id.value;
|
||||||
state->current.shown = true;
|
state->current.shown = true;
|
||||||
state->current.livestream = call->peer()->isBroadcast();
|
state->current.livestream = call->peer()->isBroadcast();
|
||||||
|
|
||||||
@@ -254,7 +258,18 @@ rpl::producer<Ui::GroupCallBarContent> GroupCallBarContentByCall(
|
|||||||
state->pushScheduled = true;
|
state->pushScheduled = true;
|
||||||
crl::on_main(&state->guard, [=] {
|
crl::on_main(&state->guard, [=] {
|
||||||
state->pushScheduled = false;
|
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));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user