/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "ui/chat/attach/attach_prepare.h" #include "ui/rp_widget.h" #include "ui/widgets/popup_menu.h" #include "ui/chat/attach/attach_send_files_way.h" #include "ui/image/image_prepare.h" #include "ui/ui_utility.h" #include "core/mime_type.h" namespace Ui { namespace { constexpr auto kMaxAlbumCount = 10; } // namespace PreparedFile::PreparedFile(const QString &path) : path(path) { } PreparedFile::PreparedFile(PreparedFile &&other) = default; PreparedFile &PreparedFile::operator=(PreparedFile &&other) = default; PreparedFile::~PreparedFile() = default; bool PreparedFile::canBeInAlbumType(AlbumType album) const { return CanBeInAlbumType(type, album); } bool PreparedFile::isSticker() const { Expects(information != nullptr); return (type == PreparedFile::Type::Photo) && Core::IsMimeSticker(information->filemime); } bool PreparedFile::isGifv() const { Expects(information != nullptr); using Video = Ui::PreparedFileInformation::Video; return (type == PreparedFile::Type::Video) && v::is