mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Moved stickerSetInstalled from ApiWrap to Data::Stickers.
This commit is contained in:
parent
7e04bf9533
commit
8d62800e77
6 changed files with 18 additions and 13 deletions
|
@ -341,12 +341,6 @@ public:
|
||||||
not_null<UserData*> user,
|
not_null<UserData*> user,
|
||||||
PhotoId afterId);
|
PhotoId afterId);
|
||||||
|
|
||||||
void stickerSetInstalled(uint64 setId) {
|
|
||||||
_stickerSetInstalled.fire_copy(setId);
|
|
||||||
}
|
|
||||||
auto stickerSetInstalled() const {
|
|
||||||
return _stickerSetInstalled.events();
|
|
||||||
}
|
|
||||||
void readFeaturedSetDelayed(uint64 setId);
|
void readFeaturedSetDelayed(uint64 setId);
|
||||||
|
|
||||||
void parseChannelParticipants(
|
void parseChannelParticipants(
|
||||||
|
@ -736,8 +730,6 @@ private:
|
||||||
|
|
||||||
base::Observable<PeerData*> _fullPeerUpdated;
|
base::Observable<PeerData*> _fullPeerUpdated;
|
||||||
|
|
||||||
rpl::event_stream<uint64> _stickerSetInstalled;
|
|
||||||
|
|
||||||
mtpRequestId _topPromotionRequestId = 0;
|
mtpRequestId _topPromotionRequestId = 0;
|
||||||
std::pair<QString, uint32> _topPromotionKey;
|
std::pair<QString, uint32> _topPromotionKey;
|
||||||
TimeId _topPromotionNextRequestTime = TimeId(0);
|
TimeId _topPromotionNextRequestTime = TimeId(0);
|
||||||
|
|
|
@ -192,7 +192,8 @@ void StickerSetBox::prepare() {
|
||||||
if (_inner->isMasksSet()) {
|
if (_inner->isMasksSet()) {
|
||||||
Ui::Toast::Show(tr::lng_masks_installed(tr::now));
|
Ui::Toast::Show(tr::lng_masks_installed(tr::now));
|
||||||
} else {
|
} else {
|
||||||
_controller->session().api().stickerSetInstalled(setId);
|
auto &stickers = _controller->session().data().stickers();
|
||||||
|
stickers.notifyStickerSetInstalled(setId);
|
||||||
}
|
}
|
||||||
closeBox();
|
closeBox();
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
|
@ -1691,7 +1691,8 @@ void StickersBox::Inner::saveGroupSet() {
|
||||||
: 0;
|
: 0;
|
||||||
if (newId != oldId) {
|
if (newId != oldId) {
|
||||||
session().api().setGroupStickerSet(_megagroupSet, _megagroupSetInput);
|
session().api().setGroupStickerSet(_megagroupSet, _megagroupSetInput);
|
||||||
session().api().stickerSetInstalled(Data::Stickers::MegagroupSetId);
|
session().data().stickers().notifyStickerSetInstalled(
|
||||||
|
Data::Stickers::MegagroupSetId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -388,8 +388,8 @@ TabbedSelector::TabbedSelector(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasStickersTab()) {
|
if (hasStickersTab()) {
|
||||||
session().api().stickerSetInstalled(
|
session().data().stickers().stickerSetInstalled(
|
||||||
) | rpl::start_with_next([this](uint64 setId) {
|
) | rpl::start_with_next([=](uint64 setId) {
|
||||||
_tabsSlider->setActiveSection(indexByType(SelectorTab::Stickers));
|
_tabsSlider->setActiveSection(indexByType(SelectorTab::Stickers));
|
||||||
stickers()->showStickerSet(setId);
|
stickers()->showStickerSet(setId);
|
||||||
_showRequests.fire({});
|
_showRequests.fire({});
|
||||||
|
|
|
@ -102,6 +102,14 @@ rpl::producer<> Stickers::savedGifsUpdated() const {
|
||||||
return _savedGifsUpdated.events();
|
return _savedGifsUpdated.events();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Stickers::notifyStickerSetInstalled(uint64 setId) {
|
||||||
|
_stickerSetInstalled.fire(std::move(setId));
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<uint64> Stickers::stickerSetInstalled() const {
|
||||||
|
return _stickerSetInstalled.events();
|
||||||
|
}
|
||||||
|
|
||||||
// Increment attached sticker.
|
// Increment attached sticker.
|
||||||
void Stickers::incrementSticker(not_null<DocumentData*> document) {
|
void Stickers::incrementSticker(not_null<DocumentData*> document) {
|
||||||
if (!document->sticker()
|
if (!document->sticker()
|
||||||
|
@ -513,7 +521,7 @@ void Stickers::setIsFaved(
|
||||||
}
|
}
|
||||||
session().local().writeFavedStickers();
|
session().local().writeFavedStickers();
|
||||||
notifyUpdated();
|
notifyUpdated();
|
||||||
session().api().stickerSetInstalled(FavedSetId);
|
notifyStickerSetInstalled(FavedSetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stickers::requestSetToPushFaved(not_null<DocumentData*> document) {
|
void Stickers::requestSetToPushFaved(not_null<DocumentData*> document) {
|
||||||
|
|
|
@ -60,6 +60,8 @@ public:
|
||||||
[[nodiscard]] rpl::producer<Recent> recentUpdated() const;
|
[[nodiscard]] rpl::producer<Recent> recentUpdated() const;
|
||||||
void notifySavedGifsUpdated();
|
void notifySavedGifsUpdated();
|
||||||
[[nodiscard]] rpl::producer<> savedGifsUpdated() const;
|
[[nodiscard]] rpl::producer<> savedGifsUpdated() const;
|
||||||
|
void notifyStickerSetInstalled(uint64 setId);
|
||||||
|
[[nodiscard]] rpl::producer<uint64> stickerSetInstalled() const;
|
||||||
|
|
||||||
void incrementSticker(not_null<DocumentData*> document);
|
void incrementSticker(not_null<DocumentData*> document);
|
||||||
|
|
||||||
|
@ -225,6 +227,7 @@ private:
|
||||||
rpl::event_stream<> _updated;
|
rpl::event_stream<> _updated;
|
||||||
rpl::event_stream<Recent> _recentUpdated;
|
rpl::event_stream<Recent> _recentUpdated;
|
||||||
rpl::event_stream<> _savedGifsUpdated;
|
rpl::event_stream<> _savedGifsUpdated;
|
||||||
|
rpl::event_stream<uint64> _stickerSetInstalled;
|
||||||
crl::time _lastUpdate = 0;
|
crl::time _lastUpdate = 0;
|
||||||
crl::time _lastRecentUpdate = 0;
|
crl::time _lastRecentUpdate = 0;
|
||||||
crl::time _lastFavedUpdate = 0;
|
crl::time _lastFavedUpdate = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue