Allow scheduling media in topic groups.

This commit is contained in:
John Preston 2024-06-06 21:14:09 +04:00
parent 86a048a021
commit d5d9da7d0a
1 changed files with 6 additions and 34 deletions

View File

@ -224,11 +224,7 @@ RepliesWidget::RepliesWidget(
listShowPremiumToast(emoji);
},
.mode = ComposeControls::Mode::Normal,
.sendMenuDetails = [=] {
using Type = SendMenu::Type;
const auto type = _topic ? Type::Scheduled : Type::SilentOnly;
return SendMenu::Details{ .type = type };
},
.sendMenuDetails = [=] { return sendMenuDetails(); },
.regularWindow = controller,
.stickerOrEmojiChosen = controller->stickerOrEmojiChosen(),
.scheduledToggleValue = _topic
@ -955,7 +951,7 @@ bool RepliesWidget::confirmSendingFiles(
_composeControls->getTextWithAppliedMarkdown(),
_history->peer,
Api::SendType::Normal,
SendMenu::Details{ SendMenu::Type::SilentOnly }); // #TODO replies schedule
sendMenuDetails());
box->setConfirmedCallback(crl::guard(this, [=](
Ui::PreparedList &&list,
@ -1088,7 +1084,6 @@ void RepliesWidget::checkReplyReturns() {
void RepliesWidget::uploadFile(
const QByteArray &fileContent,
SendMediaType type) {
// #TODO replies schedule
session().api().sendFile(fileContent, type, prepareSendAction({}));
}
@ -1138,7 +1133,7 @@ bool RepliesWidget::showSendingFilesError(
}
Api::SendAction RepliesWidget::prepareSendAction(
Api::SendOptions options) const {
Api::SendOptions options) const {
auto result = Api::SendAction(_history, options);
result.replyTo = replyTo();
result.options.sendAs = _composeControls->sendAsPeer();
@ -1150,11 +1145,6 @@ void RepliesWidget::send() {
return;
}
send({});
// #TODO replies schedule
//const auto callback = [=](Api::SendOptions options) { send(options); };
//Ui::show(
// PrepareScheduleBox(this, sendMenuType(), callback),
// Ui::LayerOption::KeepOther);
}
void RepliesWidget::sendVoice(ComposeControls::VoiceToSend &&data) {
@ -1338,13 +1328,6 @@ void RepliesWidget::refreshJoinGroupButton() {
void RepliesWidget::sendExistingDocument(
not_null<DocumentData*> document) {
sendExistingDocument(document, {}, std::nullopt);
// #TODO replies schedule
//const auto callback = [=](Api::SendOptions options) {
// sendExistingDocument(document, options);
//};
//Ui::show(
// PrepareScheduleBox(this, sendMenuType(), callback),
// Ui::LayerOption::KeepOther);
}
bool RepliesWidget::sendExistingDocument(
@ -1374,13 +1357,6 @@ bool RepliesWidget::sendExistingDocument(
void RepliesWidget::sendExistingPhoto(not_null<PhotoData*> photo) {
sendExistingPhoto(photo, {});
// #TODO replies schedule
//const auto callback = [=](Api::SendOptions options) {
// sendExistingPhoto(photo, options);
//};
//Ui::show(
// PrepareScheduleBox(this, sendMenuType(), callback),
// Ui::LayerOption::KeepOther);
}
bool RepliesWidget::sendExistingPhoto(
@ -1451,13 +1427,9 @@ void RepliesWidget::sendInlineResult(
}
SendMenu::Details RepliesWidget::sendMenuDetails() const {
// #TODO replies schedule
const auto type = _history->peer->isSelf()
? SendMenu::Type::Reminder
: HistoryView::CanScheduleUntilOnline(_history->peer)
? SendMenu::Type::ScheduledToUser
: SendMenu::Type::Scheduled;
return { .type = type, .effectAllowed = _history->peer->isUser() };
using Type = SendMenu::Type;
const auto type = _topic ? Type::Scheduled : Type::SilentOnly;
return SendMenu::Details{ .type = type };
}
FullReplyTo RepliesWidget::replyTo() const {