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