mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Leave voice chat without confirmation.
This commit is contained in:
parent
b550eb5ab2
commit
703b21b4e5
3 changed files with 16 additions and 9 deletions
Telegram/SourceFiles/calls
|
@ -315,14 +315,17 @@ void GroupPanel::initWidget() {
|
|||
}, widget()->lifetime());
|
||||
}
|
||||
|
||||
void GroupPanel::hangup(bool discardCallChecked) {
|
||||
void GroupPanel::endCall() {
|
||||
if (!_call) {
|
||||
return;
|
||||
} else if (!_call->peer()->canManageGroupCall()) {
|
||||
_call->hangup();
|
||||
return;
|
||||
}
|
||||
_layerBg->showBox(Box(
|
||||
LeaveGroupCallBox,
|
||||
_call,
|
||||
discardCallChecked,
|
||||
false,
|
||||
BoxContext::GroupCallPanel));
|
||||
}
|
||||
|
||||
|
@ -338,7 +341,7 @@ void GroupPanel::initControls() {
|
|||
: MuteState::Muted);
|
||||
}, _mute->lifetime());
|
||||
|
||||
_hangup->setClickedCallback([=] { hangup(false); });
|
||||
_hangup->setClickedCallback([=] { endCall(); });
|
||||
_settings->setClickedCallback([=] {
|
||||
if (_call) {
|
||||
_layerBg->showBox(Box(GroupCallSettingsBox, _call));
|
||||
|
|
|
@ -90,7 +90,7 @@ private:
|
|||
void updateControlsGeometry();
|
||||
void showControls();
|
||||
|
||||
void hangup(bool discardCallChecked);
|
||||
void endCall();
|
||||
|
||||
void addMembers();
|
||||
void kickMember(not_null<UserData*> user);
|
||||
|
|
|
@ -337,11 +337,15 @@ void TopBar::initControls() {
|
|||
if (const auto call = _call.get()) {
|
||||
call->hangup();
|
||||
} else if (const auto group = _groupCall.get()) {
|
||||
Ui::show(Box(
|
||||
LeaveGroupCallBox,
|
||||
group,
|
||||
false,
|
||||
BoxContext::MainWindow));
|
||||
if (!group->peer()->canManageGroupCall()) {
|
||||
group->hangup();
|
||||
} else {
|
||||
Ui::show(Box(
|
||||
LeaveGroupCallBox,
|
||||
group,
|
||||
false,
|
||||
BoxContext::MainWindow));
|
||||
}
|
||||
}
|
||||
});
|
||||
updateDurationText();
|
||||
|
|
Loading…
Add table
Reference in a new issue