2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Support sending albums to slowmode groups.

This commit is contained in:
John Preston
2019-07-18 18:09:50 +02:00
parent b23bfe8b02
commit 22f210ea8e
5 changed files with 66 additions and 43 deletions

View File

@@ -597,7 +597,8 @@ bool MainWidget::setForwardDraft(PeerId peerId, MessageIdsList &&items) {
const auto peer = session().data().peer(peerId);
const auto error = GetErrorTextForForward(
peer,
session().data().idsToItems(items));
session().data().idsToItems(items),
true);
if (!error.isEmpty()) {
Ui::show(Box<InformBox>(error), LayerOption::KeepOther);
return false;
@@ -681,10 +682,8 @@ 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))) {
const auto error = GetErrorTextForForward(history->peer, toForward);
if (!error.isEmpty()) {
return;
}