mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Moved public var indicating stickers presence to private in PhotoData.
This commit is contained in:
parent
1459e6f38e
commit
391ec8ac28
6 changed files with 20 additions and 9 deletions
|
@ -376,6 +376,14 @@ void PhotoData::updateImages(
|
|||
[&](Data::FileOrigin origin) { loadVideo(origin); });
|
||||
}
|
||||
|
||||
[[nodiscard]] bool PhotoData::hasAttachedStickers() const {
|
||||
return _hasStickers;
|
||||
}
|
||||
|
||||
void PhotoData::setHasAttachedStickers(bool value) {
|
||||
_hasStickers = value;
|
||||
}
|
||||
|
||||
int PhotoData::width() const {
|
||||
return _images[PhotoSizeIndex(PhotoSize::Large)].location.width();
|
||||
}
|
||||
|
|
|
@ -142,13 +142,15 @@ public:
|
|||
bool forceRemoteLoader) const
|
||||
-> std::unique_ptr<Media::Streaming::Loader>;
|
||||
|
||||
[[nodiscard]] bool hasAttachedStickers() const;
|
||||
void setHasAttachedStickers(bool value);
|
||||
|
||||
// For now they return size of the 'large' image.
|
||||
int width() const;
|
||||
int height() const;
|
||||
|
||||
PhotoId id = 0;
|
||||
TimeId date = 0;
|
||||
bool hasSticker = false;
|
||||
|
||||
PeerData *peer = nullptr; // for chat and channel photos connection
|
||||
// geo, caption
|
||||
|
@ -164,6 +166,7 @@ private:
|
|||
|
||||
int32 _dc = 0;
|
||||
uint64 _access = 0;
|
||||
bool _hasStickers = false;
|
||||
QByteArray _fileReference;
|
||||
std::unique_ptr<Data::ReplyPreview> _replyPreview;
|
||||
std::weak_ptr<Data::PhotoMedia> _media;
|
||||
|
|
|
@ -2291,7 +2291,7 @@ not_null<PhotoData*> Session::photo(
|
|||
const QByteArray &fileReference,
|
||||
TimeId date,
|
||||
int32 dc,
|
||||
bool hasSticker,
|
||||
bool hasStickers,
|
||||
const QByteArray &inlineThumbnailBytes,
|
||||
const ImageWithLocation &small,
|
||||
const ImageWithLocation &thumbnail,
|
||||
|
@ -2305,7 +2305,7 @@ not_null<PhotoData*> Session::photo(
|
|||
fileReference,
|
||||
date,
|
||||
dc,
|
||||
hasSticker,
|
||||
hasStickers,
|
||||
inlineThumbnailBytes,
|
||||
small,
|
||||
thumbnail,
|
||||
|
@ -2466,7 +2466,7 @@ void Session::photoApplyFields(
|
|||
const QByteArray &fileReference,
|
||||
TimeId date,
|
||||
int32 dc,
|
||||
bool hasSticker,
|
||||
bool hasStickers,
|
||||
const QByteArray &inlineThumbnailBytes,
|
||||
const ImageWithLocation &small,
|
||||
const ImageWithLocation &thumbnail,
|
||||
|
@ -2478,7 +2478,7 @@ void Session::photoApplyFields(
|
|||
}
|
||||
photo->setRemoteLocation(dc, access, fileReference);
|
||||
photo->date = date;
|
||||
photo->hasSticker = hasSticker;
|
||||
photo->setHasAttachedStickers(hasStickers);
|
||||
photo->updateImages(
|
||||
inlineThumbnailBytes,
|
||||
small,
|
||||
|
|
|
@ -414,7 +414,7 @@ public:
|
|||
const QByteArray &fileReference,
|
||||
TimeId date,
|
||||
int32 dc,
|
||||
bool hasSticker,
|
||||
bool hasStickers,
|
||||
const QByteArray &inlineThumbnailBytes,
|
||||
const ImageWithLocation &small,
|
||||
const ImageWithLocation &thumbnail,
|
||||
|
@ -685,7 +685,7 @@ private:
|
|||
const QByteArray &fileReference,
|
||||
TimeId date,
|
||||
int32 dc,
|
||||
bool hasSticker,
|
||||
bool hasStickers,
|
||||
const QByteArray &inlineThumbnailBytes,
|
||||
const ImageWithLocation &small,
|
||||
const ImageWithLocation &thumbnail,
|
||||
|
|
|
@ -1589,7 +1589,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
|||
_menu->addAction(tr::lng_context_copy_image(tr::now), [=] {
|
||||
copyContextImage(photo);
|
||||
});
|
||||
if (photo->hasSticker) {
|
||||
if (photo->hasAttachedStickers()) {
|
||||
_menu->addAction(tr::lng_context_attached_stickers(tr::now), [=] {
|
||||
session->api().attachedStickers().requestAttachedStickerSets(
|
||||
controller,
|
||||
|
|
|
@ -773,7 +773,7 @@ void OverlayWidget::updateActions() {
|
|||
if ((_document && documentContentShown()) || (_photo && _photoMedia->loaded())) {
|
||||
_actions.push_back({ tr::lng_mediaview_copy(tr::now), SLOT(onCopy()) });
|
||||
}
|
||||
if (_photo && _photo->hasSticker) {
|
||||
if (_photo && _photo->hasAttachedStickers()) {
|
||||
_actions.push_back({ tr::lng_context_attached_stickers(tr::now), SLOT(onAttachedStickers()) });
|
||||
}
|
||||
if (_canForwardItem) {
|
||||
|
|
Loading…
Add table
Reference in a new issue