mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Show call button only when you can create voice chat.
This commit is contained in:
@@ -127,12 +127,22 @@ TopBarWidget::TopBarWidget(
|
||||
| UpdateFlag::OnlineStatus
|
||||
| UpdateFlag::Members
|
||||
| UpdateFlag::SupportInfo
|
||||
| UpdateFlag::Rights
|
||||
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
|
||||
if (update.flags & UpdateFlag::HasCalls) {
|
||||
if (update.peer->isUser()) {
|
||||
if (update.peer->isUser()
|
||||
&& (update.peer->isSelf()
|
||||
|| _activeChat.key.peer() == update.peer)) {
|
||||
updateControlsVisibility();
|
||||
}
|
||||
} else {
|
||||
} else if ((update.flags & UpdateFlag::Rights)
|
||||
&& (_activeChat.key.peer() == update.peer)) {
|
||||
updateControlsVisibility();
|
||||
}
|
||||
if (update.flags
|
||||
& (UpdateFlag::OnlineStatus
|
||||
| UpdateFlag::Members
|
||||
| UpdateFlag::SupportInfo)) {
|
||||
updateOnlineDisplay();
|
||||
}
|
||||
}, lifetime());
|
||||
@@ -694,7 +704,7 @@ void TopBarWidget::updateControlsVisibility() {
|
||||
return session().serverConfig().phoneCallsEnabled.current()
|
||||
&& user->hasCalls();
|
||||
} else if (const auto megagroup = peer->asMegagroup()) {
|
||||
return true;
|
||||
return megagroup->canManageCall();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user