Correctly parse restriction error when sending GIFs
This commit is contained in:
parent
9ee1e4347b
commit
fd2aebc1d5
1 changed files with 5 additions and 3 deletions
|
|
@ -5631,9 +5631,11 @@ void HistoryWidget::destroyPinnedBar() {
|
||||||
bool HistoryWidget::sendExistingDocument(
|
bool HistoryWidget::sendExistingDocument(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
Api::SendOptions options) {
|
Api::SendOptions options) {
|
||||||
const auto error = _peer
|
const auto error = !_peer
|
||||||
? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers)
|
? std::nullopt
|
||||||
: std::nullopt;
|
: document->sticker()
|
||||||
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers)
|
||||||
|
: Data::RestrictionError(_peer, ChatRestriction::f_send_gifs);
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue