Allow disabling animated emoji.

This commit is contained in:
John Preston 2019-08-02 11:52:35 +01:00
parent 93a52bb66e
commit fd59147b8a
2 changed files with 15 additions and 1 deletions

View File

@ -30,6 +30,13 @@ EmojiPack::EmojiPack(not_null<Main::Session*> session) : _session(session) {
}) | rpl::start_with_next([=](not_null<const HistoryItem*> 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<HistoryItem*> item, const QString &text) {
@ -65,7 +72,7 @@ bool EmojiPack::remove(not_null<const HistoryItem*> item) {
}
DocumentData *EmojiPack::stickerForEmoji(not_null<HistoryItem*> item) {
if (!item->isSingleEmoji()) {
if (!item->isSingleEmoji() || !_session->settings().largeEmoji()) {
return nullptr;
}
auto length = 0;

View File

@ -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<HistoryItem*> item) {
if (const auto view = item->mainView()) {