2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Pass FileOrigin in all file downloads.

This commit is contained in:
John Preston
2018-07-14 00:25:47 +03:00
parent ee16070abe
commit 839885910c
67 changed files with 1021 additions and 510 deletions

View File

@@ -395,7 +395,9 @@ bool MainWindow::ui_isLayerShown() {
return _layer != nullptr;
}
void MainWindow::ui_showMediaPreview(DocumentData *document) {
void MainWindow::ui_showMediaPreview(
Data::FileOrigin origin,
not_null<DocumentData*> document) {
if (!document || ((!document->isAnimation() || !document->loaded()) && !document->sticker())) {
return;
}
@@ -406,11 +408,15 @@ void MainWindow::ui_showMediaPreview(DocumentData *document) {
if (_mediaPreview->isHidden()) {
fixOrder();
}
_mediaPreview->showPreview(document);
_mediaPreview->showPreview(origin, document);
}
void MainWindow::ui_showMediaPreview(PhotoData *photo) {
if (!photo) return;
void MainWindow::ui_showMediaPreview(
Data::FileOrigin origin,
not_null<PhotoData*> photo) {
if (!photo) {
return;
}
if (!_mediaPreview) {
_mediaPreview.create(bodyWidget(), controller());
updateControlsGeometry();
@@ -418,7 +424,7 @@ void MainWindow::ui_showMediaPreview(PhotoData *photo) {
if (_mediaPreview->isHidden()) {
fixOrder();
}
_mediaPreview->showPreview(photo);
_mediaPreview->showPreview(origin, photo);
}
void MainWindow::ui_hideMediaPreview() {