2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Move stickers code to Data::Stickers class.

This commit is contained in:
John Preston
2020-06-08 21:24:36 +04:00
parent 27af83267e
commit fc174f742a
39 changed files with 1461 additions and 1304 deletions

View File

@@ -17,8 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h"
#include "core/file_utilities.h"
#include "core/mime_type.h"
#include "chat_helpers/stickers.h"
#include "chat_helpers/stickers_set.h"
#include "data/stickers/data_stickers.h"
#include "data/stickers/data_stickers_set.h"
#include "media/audio/media_audio.h"
#include "media/player/media_player_instance.h"
#include "media/streaming/media_streaming_loader_mtproto.h"
@@ -1208,7 +1208,7 @@ bool DocumentData::saveFromDataChecked() {
bool DocumentData::isStickerSetInstalled() const {
Expects(sticker() != nullptr);
const auto &sets = _owner->stickerSets();
const auto &sets = _owner->stickers().sets();
return sticker()->set.match([&](const MTPDinputStickerSetID &data) {
const auto i = sets.find(data.vid().v);
return (i != sets.cend())
@@ -1251,8 +1251,8 @@ Data::FileOrigin DocumentData::stickerSetOrigin() const {
if (const auto data = sticker()) {
if (const auto result = data->setOrigin()) {
return result;
} else if (Stickers::IsFaved(this)) {
return Data::FileOriginStickerSet(Stickers::FavedSetId, 0);
} else if (owner().stickers().isFaved(this)) {
return Data::FileOriginStickerSet(Data::Stickers::FavedSetId, 0);
}
}
return Data::FileOrigin();