mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed showing of rate call box in appropriate window.
This commit is contained in:
parent
a0e0fd5b98
commit
893c09c848
1 changed files with 17 additions and 4 deletions
|
@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "mtproto/mtproto_config.h"
|
#include "mtproto/mtproto_config.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "core/core_settings.h"
|
#include "core/core_settings.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
#include "media/audio/media_audio_track.h"
|
#include "media/audio/media_audio_track.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "calls/calls_panel.h"
|
#include "calls/calls_panel.h"
|
||||||
|
@ -706,11 +707,15 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.is_need_rating() && _id && _accessHash) {
|
if (data.is_need_rating() && _id && _accessHash) {
|
||||||
|
const auto window = Core::App().windowFor(_user);
|
||||||
const auto session = &_user->session();
|
const auto session = &_user->session();
|
||||||
const auto callId = _id;
|
const auto callId = _id;
|
||||||
const auto callAccessHash = _accessHash;
|
const auto callAccessHash = _accessHash;
|
||||||
const auto box = Ui::show(Box<Ui::RateCallBox>(
|
auto owned = Box<Ui::RateCallBox>(
|
||||||
Core::App().settings().sendSubmitWay()));
|
Core::App().settings().sendSubmitWay());
|
||||||
|
const auto box = window
|
||||||
|
? window->show(std::move(owned))
|
||||||
|
: Ui::show(std::move(owned));
|
||||||
const auto sender = box->lifetime().make_state<MTP::Sender>(
|
const auto sender = box->lifetime().make_state<MTP::Sender>(
|
||||||
&session->mtp());
|
&session->mtp());
|
||||||
box->sends(
|
box->sends(
|
||||||
|
@ -1377,7 +1382,11 @@ void Call::handleRequestError(const QString &error) {
|
||||||
_user->name())
|
_user->name())
|
||||||
: QString();
|
: QString();
|
||||||
if (!inform.isEmpty()) {
|
if (!inform.isEmpty()) {
|
||||||
Ui::show(Ui::MakeInformBox(inform));
|
if (const auto window = Core::App().windowFor(_user)) {
|
||||||
|
window->show(Ui::MakeInformBox(inform));
|
||||||
|
} else {
|
||||||
|
Ui::show(Ui::MakeInformBox(inform));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finish(FinishType::Failed);
|
finish(FinishType::Failed);
|
||||||
}
|
}
|
||||||
|
@ -1391,7 +1400,11 @@ void Call::handleControllerError(const QString &error) {
|
||||||
? tr::lng_call_error_audio_io(tr::now)
|
? tr::lng_call_error_audio_io(tr::now)
|
||||||
: QString();
|
: QString();
|
||||||
if (!inform.isEmpty()) {
|
if (!inform.isEmpty()) {
|
||||||
Ui::show(Ui::MakeInformBox(inform));
|
if (const auto window = Core::App().windowFor(_user)) {
|
||||||
|
window->show(Ui::MakeInformBox(inform));
|
||||||
|
} else {
|
||||||
|
Ui::show(Ui::MakeInformBox(inform));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finish(FinishType::Failed);
|
finish(FinishType::Failed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue