mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added ability to start outgoing call without user confirmation.
This commit is contained in:
@@ -196,7 +196,9 @@ Instance::~Instance() {
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
|
||||
void Instance::startOutgoingCall(
|
||||
not_null<UserData*> user,
|
||||
StartOutgoingCallArgs args) {
|
||||
if (activateCurrentCall()) {
|
||||
return;
|
||||
}
|
||||
@@ -210,8 +212,8 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
|
||||
return;
|
||||
}
|
||||
requestPermissionsOrFail(crl::guard(this, [=] {
|
||||
createCall(user, Call::Type::Outgoing, video);
|
||||
}), video);
|
||||
createCall(user, Call::Type::Outgoing, args);
|
||||
}), args.video);
|
||||
}
|
||||
|
||||
void Instance::startOrJoinGroupCall(
|
||||
@@ -413,7 +415,7 @@ void Instance::destroyCall(not_null<Call*> call) {
|
||||
void Instance::createCall(
|
||||
not_null<UserData*> user,
|
||||
CallType type,
|
||||
bool isVideo) {
|
||||
StartOutgoingCallArgs args) {
|
||||
struct Performer final {
|
||||
explicit Performer(Fn<void(bool, bool, const Performer &)> callback)
|
||||
: callback(std::move(callback)) {
|
||||
@@ -455,7 +457,7 @@ void Instance::createCall(
|
||||
}
|
||||
_currentCallChanges.fire_copy(raw);
|
||||
});
|
||||
performer.callback(isVideo, false, performer);
|
||||
performer.callback(args.video, args.isConfirmed, performer);
|
||||
}
|
||||
|
||||
void Instance::destroyGroupCall(not_null<GroupCall*> call) {
|
||||
@@ -702,7 +704,7 @@ void Instance::handleCallUpdate(
|
||||
< base::unixtime::now()) {
|
||||
LOG(("Ignoring too old call."));
|
||||
} else {
|
||||
createCall(user, Call::Type::Incoming, phoneCall.is_video());
|
||||
createCall(user, Call::Type::Incoming, { phoneCall.is_video() });
|
||||
_currentCall->handleUpdate(call);
|
||||
}
|
||||
} else if (!_currentCall
|
||||
|
||||
Reference in New Issue
Block a user