2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Disallow accidental failing forwarding.

This commit is contained in:
John Preston
2019-07-17 17:46:12 +02:00
parent c50ade565a
commit 234b0ffcf0
2 changed files with 12 additions and 1 deletions

View File

@@ -681,6 +681,13 @@ void MainWidget::cancelForwarding(not_null<History*> history) {
void MainWidget::finishForwarding(not_null<History*> history) {
auto toForward = history->validateForwardDraft();
if (!toForward.empty()) {
if (history->peer->slowmodeSecondsLeft()
|| (history->peer->slowmodeApplied()
&& (toForward.size() > 1
|| history->latestSendingMessage() != nullptr))) {
return;
}
auto options = ApiWrap::SendOptions(history);
session().api().forwardMessages(std::move(toForward), options);
cancelForwarding(history);