diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 8556b5712..7263e7aa0 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2858,13 +2858,15 @@ void HistoryWidget::send(bool silent, Qt::KeyboardModifiers modifiers) { message.silent = silent; message.handleSupportSwitch = Support::HandleSwitch(modifiers); - const auto error = GetErrorTextForForward( - _peer, - _toForward, - message.textWithTags); - if (!error.isEmpty()) { - ShowErrorToast(error); - return; + if (_canSendMessages) { + const auto error = GetErrorTextForForward( + _peer, + _toForward, + message.textWithTags); + if (!error.isEmpty()) { + ShowErrorToast(error); + return; + } } session().api().sendMessage(std::move(message)); @@ -5280,7 +5282,9 @@ void HistoryWidget::keyPressEvent(QKeyEvent *e) { const auto submitting = Ui::InputField::ShouldSubmit( session().settings().sendSubmitWay(), e->modifiers()); - send(false, e->modifiers()); + if (submitting) { + send(false, e->modifiers()); + } } } else if (e->key() == Qt::Key_O && e->modifiers() == Qt::ControlModifier) { chooseAttach();