From fd2aebc1d59ecc4d22a5dec506b7919d32f81cee Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Wed, 22 Jul 2020 21:55:05 +0300 Subject: [PATCH] Correctly parse restriction error when sending GIFs --- Telegram/SourceFiles/history/history_widget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 238939d2b..593f73a69 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5631,9 +5631,11 @@ void HistoryWidget::destroyPinnedBar() { bool HistoryWidget::sendExistingDocument( not_null document, Api::SendOptions options) { - const auto error = _peer - ? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers) - : std::nullopt; + const auto error = !_peer + ? std::nullopt + : document->sticker() + ? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers) + : Data::RestrictionError(_peer, ChatRestriction::f_send_gifs); if (error) { Ui::show(Box(*error), Ui::LayerOption::KeepOther); return false;