mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show bot app name in title.
This commit is contained in:
parent
b3c8a79946
commit
b347308137
2 changed files with 6 additions and 1 deletions
|
@ -1253,6 +1253,7 @@ void WebViewInstance::requestApp(bool allowWrite) {
|
||||||
|
|
||||||
using Flag = MTPmessages_RequestAppWebView::Flag;
|
using Flag = MTPmessages_RequestAppWebView::Flag;
|
||||||
const auto app = _app;
|
const auto app = _app;
|
||||||
|
const auto title = app->title;
|
||||||
const auto flags = Flag::f_theme_params
|
const auto flags = Flag::f_theme_params
|
||||||
| (_context.fullscreen ? Flag::f_fullscreen : Flag(0))
|
| (_context.fullscreen ? Flag::f_fullscreen : Flag(0))
|
||||||
| (_appStartParam.isEmpty() ? Flag(0) : Flag::f_start_param)
|
| (_appStartParam.isEmpty() ? Flag(0) : Flag::f_start_param)
|
||||||
|
@ -1269,6 +1270,7 @@ void WebViewInstance::requestApp(bool allowWrite) {
|
||||||
const auto &data = result.data();
|
const auto &data = result.data();
|
||||||
show({
|
show({
|
||||||
.url = qs(data.vurl()),
|
.url = qs(data.vurl()),
|
||||||
|
.title = title,
|
||||||
.fullscreen = data.is_fullscreen(),
|
.fullscreen = data.is_fullscreen(),
|
||||||
});
|
});
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
|
@ -1350,7 +1352,9 @@ void WebViewInstance::maybeChooseAndRequestButton(PeerTypes supported) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebViewInstance::show(ShowArgs &&args) {
|
void WebViewInstance::show(ShowArgs &&args) {
|
||||||
auto title = Info::Profile::NameValue(_bot);
|
auto title = args.title.isEmpty()
|
||||||
|
? Info::Profile::NameValue(_bot)
|
||||||
|
: rpl::single(args.title);
|
||||||
auto titleBadge = _bot->isVerified()
|
auto titleBadge = _bot->isVerified()
|
||||||
? object_ptr<Ui::RpWidget>(_parentShow->toastParent())
|
? object_ptr<Ui::RpWidget>(_parentShow->toastParent())
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
|
|
@ -247,6 +247,7 @@ private:
|
||||||
|
|
||||||
struct ShowArgs {
|
struct ShowArgs {
|
||||||
QString url;
|
QString url;
|
||||||
|
QString title;
|
||||||
uint64 queryId = 0;
|
uint64 queryId = 0;
|
||||||
bool fullscreen = false;
|
bool fullscreen = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue