From fd59147b8a8b98d46ee910cab1e7581b8095247a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 2 Aug 2019 11:52:35 +0100 Subject: [PATCH] Allow disabling animated emoji. --- .../SourceFiles/chat_helpers/stickers_emoji_pack.cpp | 9 ++++++++- Telegram/SourceFiles/history/history_widget.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp index f317b54444..03231e8654 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp @@ -30,6 +30,13 @@ EmojiPack::EmojiPack(not_null session) : _session(session) { }) | rpl::start_with_next([=](not_null item) { remove(item); }, _lifetime); + + session->settings().largeEmojiChanges( + ) | rpl::start_with_next([=] { + for (const auto &[emoji, document] : _map) { + refreshItems(emoji); + } + }, _lifetime); } bool EmojiPack::add(not_null item, const QString &text) { @@ -65,7 +72,7 @@ bool EmojiPack::remove(not_null item) { } DocumentData *EmojiPack::stickerForEmoji(not_null item) { - if (!item->isSingleEmoji()) { + if (!item->isSingleEmoji() || !_session->settings().largeEmoji()) { return nullptr; } auto length = 0; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index f0e085204d..c5d317c532 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -482,6 +482,13 @@ HistoryWidget::HistoryWidget( } }, lifetime()); + session().settings().largeEmojiChanges( + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { + updateHistoryGeometry(); + }); + }, lifetime()); + session().data().animationPlayInlineRequest( ) | rpl::start_with_next([=](not_null item) { if (const auto view = item->mainView()) {