From 6fcafeff5baf28809f2f09c8dc72330fe11eb951 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 22 Sep 2022 14:58:21 +0400 Subject: [PATCH] Don't repeat premium stickers in fake-pack. --- .../SourceFiles/chat_helpers/stickers_list_widget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 2e989cb84..43e1f4ef9 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -2042,8 +2042,12 @@ bool StickersListWidget::appendSet( for (const auto &sticker : to.back().stickers) { const auto document = sticker.document; if (document->isPremiumSticker()) { - to[_premiumsIndex].stickers.push_back(Sticker{ document }); - ++to[_premiumsIndex].count; + auto &set = to[_premiumsIndex]; + auto &list = set.stickers; + if (!ranges::contains(list, document, &Sticker::document)) { + list.push_back(Sticker{ document }); + ++set.count; + } } } }