mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Check file by server before downloading.
This commit is contained in:
parent
341ab781b2
commit
ef521624a0
1 changed files with 15 additions and 7 deletions
|
@ -1910,13 +1910,21 @@ void WebViewInstance::botDownloadFile(
|
||||||
});
|
});
|
||||||
callback(true);
|
callback(true);
|
||||||
};
|
};
|
||||||
_panel->showBox(Box(DownloadFileBox, DownloadBoxArgs{
|
_bot->session().api().request(MTPbots_CheckDownloadFileParams(
|
||||||
.session = &_bot->session(),
|
_bot->inputUser,
|
||||||
.bot = _bot->name(),
|
MTP_string(request.name),
|
||||||
.name = base::FileNameFromUserString(request.name),
|
MTP_string(request.url)
|
||||||
.url = request.url,
|
)).done([=] {
|
||||||
.done = done,
|
_panel->showBox(Box(DownloadFileBox, DownloadBoxArgs{
|
||||||
}));
|
.session = &_bot->session(),
|
||||||
|
.bot = _bot->name(),
|
||||||
|
.name = base::FileNameFromUserString(request.name),
|
||||||
|
.url = request.url,
|
||||||
|
.done = done,
|
||||||
|
}));
|
||||||
|
}).fail([=] {
|
||||||
|
done(QString());
|
||||||
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebViewInstance::botOpenPrivacyPolicy() {
|
void WebViewInstance::botOpenPrivacyPolicy() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue