2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 06:07:45 +00:00

Correctly parse restriction error when sending GIFs

This commit is contained in:
RadRussianRus 2020-07-22 21:55:05 +03:00
parent 9ee1e4347b
commit fd2aebc1d5

View File

@ -5631,9 +5631,11 @@ void HistoryWidget::destroyPinnedBar() {
bool HistoryWidget::sendExistingDocument(
not_null<DocumentData*> 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<InformBox>(*error), Ui::LayerOption::KeepOther);
return false;