mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Correctly parse restriction error when sending GIFs
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user