Quick fix for 'Cant forward here' error.

This commit is contained in:
John Preston 2019-08-19 15:25:48 +03:00
parent b814c6307a
commit 7316d24ca4
1 changed files with 12 additions and 8 deletions

View File

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