mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +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
|
@ -315,14 +315,17 @@ void GroupPanel::initWidget() {
|
||||||
}, widget()->lifetime());
|
}, widget()->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupPanel::hangup(bool discardCallChecked) {
|
void GroupPanel::endCall() {
|
||||||
if (!_call) {
|
if (!_call) {
|
||||||
return;
|
return;
|
||||||
|
} else if (!_call->peer()->canManageGroupCall()) {
|
||||||
|
_call->hangup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
_layerBg->showBox(Box(
|
_layerBg->showBox(Box(
|
||||||
LeaveGroupCallBox,
|
LeaveGroupCallBox,
|
||||||
_call,
|
_call,
|
||||||
discardCallChecked,
|
false,
|
||||||
BoxContext::GroupCallPanel));
|
BoxContext::GroupCallPanel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +341,7 @@ void GroupPanel::initControls() {
|
||||||
: MuteState::Muted);
|
: MuteState::Muted);
|
||||||
}, _mute->lifetime());
|
}, _mute->lifetime());
|
||||||
|
|
||||||
_hangup->setClickedCallback([=] { hangup(false); });
|
_hangup->setClickedCallback([=] { endCall(); });
|
||||||
_settings->setClickedCallback([=] {
|
_settings->setClickedCallback([=] {
|
||||||
if (_call) {
|
if (_call) {
|
||||||
_layerBg->showBox(Box(GroupCallSettingsBox, _call));
|
_layerBg->showBox(Box(GroupCallSettingsBox, _call));
|
||||||
|
|
|
@ -90,7 +90,7 @@ private:
|
||||||
void updateControlsGeometry();
|
void updateControlsGeometry();
|
||||||
void showControls();
|
void showControls();
|
||||||
|
|
||||||
void hangup(bool discardCallChecked);
|
void endCall();
|
||||||
|
|
||||||
void addMembers();
|
void addMembers();
|
||||||
void kickMember(not_null<UserData*> user);
|
void kickMember(not_null<UserData*> user);
|
||||||
|
|
|
@ -337,11 +337,15 @@ void TopBar::initControls() {
|
||||||
if (const auto call = _call.get()) {
|
if (const auto call = _call.get()) {
|
||||||
call->hangup();
|
call->hangup();
|
||||||
} else if (const auto group = _groupCall.get()) {
|
} else if (const auto group = _groupCall.get()) {
|
||||||
Ui::show(Box(
|
if (!group->peer()->canManageGroupCall()) {
|
||||||
LeaveGroupCallBox,
|
group->hangup();
|
||||||
group,
|
} else {
|
||||||
false,
|
Ui::show(Box(
|
||||||
BoxContext::MainWindow));
|
LeaveGroupCallBox,
|
||||||
|
group,
|
||||||
|
false,
|
||||||
|
BoxContext::MainWindow));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateDurationText();
|
updateDurationText();
|
||||||
|
|
Loading…
Add table
Reference in a new issue