From ebded1b4211041cf1e52fabf17c36d2d99a94772 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 18 Nov 2021 11:40:15 +0400 Subject: [PATCH] Use Photo/DocumentData::isNull instead of date check. --- Telegram/SourceFiles/calls/calls_userpic.cpp | 2 +- Telegram/SourceFiles/data/data_document_resolver.cpp | 2 +- Telegram/SourceFiles/data/data_file_click_handler.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_userpic.cpp b/Telegram/SourceFiles/calls/calls_userpic.cpp index 446757af20..7b31a8c158 100644 --- a/Telegram/SourceFiles/calls/calls_userpic.cpp +++ b/Telegram/SourceFiles/calls/calls_userpic.cpp @@ -137,7 +137,7 @@ void Userpic::processPhoto() { _photo->wanted(Data::PhotoSize::Thumbnail, _peer->userpicPhotoOrigin()); } else { _photo = nullptr; - if (_peer->userpicPhotoUnknown() || (photo && !photo->date)) { + if (_peer->userpicPhotoUnknown() || (photo && photo->isNull())) { _peer->session().api().requestFullPeer(_peer); } } diff --git a/Telegram/SourceFiles/data/data_document_resolver.cpp b/Telegram/SourceFiles/data/data_document_resolver.cpp index ef2d51e7c6..7c23357347 100644 --- a/Telegram/SourceFiles/data/data_document_resolver.cpp +++ b/Telegram/SourceFiles/data/data_document_resolver.cpp @@ -206,7 +206,7 @@ void ResolveDocument( Window::SessionController *controller, not_null document, HistoryItem *item) { - if (!document->date) { + if (document->isNull()) { return; } const auto msgId = item ? item->fullId() : FullMsgId(); diff --git a/Telegram/SourceFiles/data/data_file_click_handler.cpp b/Telegram/SourceFiles/data/data_file_click_handler.cpp index e4a9ad934f..ae82e775f9 100644 --- a/Telegram/SourceFiles/data/data_file_click_handler.cpp +++ b/Telegram/SourceFiles/data/data_file_click_handler.cpp @@ -63,7 +63,7 @@ void DocumentSaveClickHandler::Save( Data::FileOrigin origin, not_null data, Mode mode) { - if (!data->date) { + if (data->isNull()) { return; } @@ -107,7 +107,7 @@ DocumentCancelClickHandler::DocumentCancelClickHandler( void DocumentCancelClickHandler::onClickImpl() const { const auto data = document(); - if (!data->date) { + if (data->isNull()) { return; } else if (data->uploading() && _handler) { _handler(context()); @@ -119,7 +119,7 @@ void DocumentCancelClickHandler::onClickImpl() const { void DocumentOpenWithClickHandler::Open( Data::FileOrigin origin, not_null data) { - if (!data->date) { + if (data->isNull()) { return; } @@ -171,7 +171,7 @@ void PhotoOpenClickHandler::onClickImpl() const { void PhotoSaveClickHandler::onClickImpl() const { const auto data = photo(); - if (!data->date) { + if (data->isNull()) { return; } else { data->clearFailed(Data::PhotoSize::Large); @@ -189,7 +189,7 @@ PhotoCancelClickHandler::PhotoCancelClickHandler( void PhotoCancelClickHandler::onClickImpl() const { const auto data = photo(); - if (!data->date) { + if (data->isNull()) { return; } else if (data->uploading() && _handler) { _handler(context());