2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Optimize emoji / stickers update requests.

This commit is contained in:
John Preston
2022-07-26 17:45:41 +03:00
parent 4f7aa15416
commit 4cf4b6a368
15 changed files with 96 additions and 59 deletions

View File

@@ -1679,7 +1679,7 @@ void ApiWrap::saveStickerSets(
if (writeFaved) {
storage.writeFavedStickers();
}
_session->data().stickers().notifyUpdated();
_session->data().stickers().notifyUpdated(type);
if (setDisenableRequests.empty()) {
stickersSaveOrder();
@@ -2555,7 +2555,7 @@ void ApiWrap::setGroupStickerSet(
megagroup->inputChannel,
Data::InputStickerSet(set)
)).send();
_session->data().stickers().notifyUpdated();
_session->data().stickers().notifyUpdated(Data::StickersType::Stickers);
}
std::vector<not_null<DocumentData*>> *ApiWrap::stickersByEmoji(
@@ -2595,7 +2595,8 @@ std::vector<not_null<DocumentData*>> *ApiWrap::stickersByEmoji(
}
entry.hash = data.vhash().v;
entry.received = crl::now();
_session->data().stickers().notifyUpdated();
_session->data().stickers().notifyUpdated(
Data::StickersType::Stickers);
}).send();
}
if (it == _stickersByEmoji.end()) {
@@ -2864,7 +2865,8 @@ void ApiWrap::readFeaturedSets() {
MTP_vector<MTPlong>(wrappedIds));
request(std::move(requestData)).done([=] {
local().writeFeaturedStickers();
_session->data().stickers().notifyUpdated();
_session->data().stickers().notifyUpdated(
Data::StickersType::Stickers);
}).send();
_session->data().stickers().setFeaturedSetsUnreadCount(count);