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

Simplify stickers inner API.

This commit is contained in:
John Preston
2022-08-15 11:33:24 +03:00
parent 94e4a8981f
commit fede1ff173
6 changed files with 12 additions and 12 deletions

View File

@@ -416,7 +416,7 @@ StickersBox::StickersBox(
StickersBox::StickersBox(
QWidget*,
not_null<Window::SessionController*> controller,
const MTPVector<MTPStickerSetCovered> &attachedSets)
const QVector<MTPStickerSetCovered> &attachedSets)
: _controller(controller)
, _api(&controller->session().mtp())
, _section(Section::Attached)
@@ -460,8 +460,8 @@ void StickersBox::showAttachedStickers() {
}
}
};
for (const auto &set : _attachedSets.v) {
add(stickers->feedSetCovered(set));
for (const auto &set : _attachedSets) {
add(stickers->feedSet(set));
}
for (const auto &setId : _emojiSets) {
const auto i = stickers->sets().find(setId.id);
@@ -501,7 +501,7 @@ void StickersBox::getArchivedDone(
auto addedSet = false;
auto changedSets = false;
for (const auto &data : stickers.vsets().v) {
const auto set = session().data().stickers().feedSetCovered(data);
const auto set = session().data().stickers().feedSet(data);
const auto index = archived.indexOf(set->id);
if (archived.isEmpty() || index != archived.size() - 1) {
changedSets = true;

View File

@@ -70,7 +70,7 @@ public:
StickersBox(
QWidget*,
not_null<Window::SessionController*> controller,
const MTPVector<MTPStickerSetCovered> &attachedSets);
const QVector<MTPStickerSetCovered> &attachedSets);
StickersBox(
QWidget*,
not_null<Window::SessionController*> controller,
@@ -164,7 +164,7 @@ private:
Tab *_tab = nullptr;
const Data::StickersType _attachedType = {};
const MTPVector<MTPStickerSetCovered> _attachedSets;
const QVector<MTPStickerSetCovered> _attachedSets;
const std::vector<StickerSetIdentifier> _emojiSets;
ChannelData *_megagroupSet = nullptr;