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

Move a lot of code from scheme.h to scheme.cpp.

This commit is contained in:
John Preston
2017-08-12 10:17:33 +03:00
parent 1207ddb2ea
commit c8810f87b9
19 changed files with 447 additions and 387 deletions

View File

@@ -524,7 +524,7 @@ void FeaturedSetsReceived(const QVector<MTPStickerSetCovered> &data, const QVect
if (set) {
auto it = sets.find(set->vid.v);
auto title = stickerSetTitle(*set);
auto title = GetSetTitle(*set);
if (it == sets.cend()) {
auto setClientFlags = MTPDstickerSet_ClientFlag::f_featured | MTPDstickerSet_ClientFlag::f_not_loaded;
if (unreadMap.contains(set->vid.v)) {
@@ -684,7 +684,7 @@ std::vector<gsl::not_null<EmojiPtr>> GetEmojiListFromSet(gsl::not_null<DocumentD
Set *FeedSet(const MTPDstickerSet &set) {
auto &sets = Global::RefStickerSets();
auto it = sets.find(set.vid.v);
auto title = stickerSetTitle(set);
auto title = GetSetTitle(set);
auto flags = MTPDstickerSet::Flags(0);
if (it == sets.cend()) {
it = sets.insert(set.vid.v, Stickers::Set(set.vid.v, set.vaccess_hash.v, title, qs(set.vshort_name), set.vcount.v, set.vhash.v, set.vflags.v | MTPDstickerSet_ClientFlag::f_not_loaded));
@@ -807,6 +807,14 @@ Set *FeedSetFull(const MTPmessages_StickerSet &data) {
return set;
}
QString GetSetTitle(const MTPDstickerSet &s) {
auto title = qs(s.vtitle);
if ((s.vflags.v & MTPDstickerSet::Flag::f_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
return lang(lng_stickers_default_set);
}
return title;
}
namespace internal {
FeaturedReader::FeaturedReader(QObject *parent) : QObject(parent)

View File

@@ -45,6 +45,8 @@ std::vector<gsl::not_null<EmojiPtr>> GetEmojiListFromSet(gsl::not_null<DocumentD
Set *FeedSet(const MTPDstickerSet &data);
Set *FeedSetFull(const MTPmessages_StickerSet &data);
QString GetSetTitle(const MTPDstickerSet &s);
namespace internal {
class FeaturedReader : public QObject, private MTP::Sender {