From cc3b6d53ab3c23baf98d430916c19c8569b1586f Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Mon, 7 Sep 2020 05:47:09 +0300 Subject: [PATCH] Show button to remove recent sticker It's already present, but only for local stickers. --- .../SourceFiles/chat_helpers/stickers_list_widget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 11b713b55..c8244ca19 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -2214,6 +2214,10 @@ void StickersListWidget::removeRecentSticker(int section, int index) { } } } + Api::ToggleRecentSticker( + document, + Data::FileOriginStickerSet(Data::Stickers::RecentSetId, 0), + false); if (refresh) { refreshRecentStickers(); updateSelected(); @@ -2822,11 +2826,8 @@ bool StickersListWidget::setHasTitle(const Set &set) const { } bool StickersListWidget::stickerHasDeleteButton(const Set &set, int index) const { - if (set.id == Data::Stickers::RecentSetId) { - Assert(index >= 0 && index < _custom.size()); - return _custom[index]; - } - return (set.id == Data::Stickers::FavedSetId); + return (set.id == Data::Stickers::RecentSetId + || set.id == Data::Stickers::FavedSetId); } void StickersListWidget::setSelected(OverState newSelected) {