PoC suggesting posts to channels.

This commit is contained in:
John Preston
2025-06-13 14:39:30 +04:00
parent 8dbc175c02
commit 7e5a29a5cc
42 changed files with 712 additions and 58 deletions

View File

@@ -359,6 +359,7 @@ WebViewContext ResolveContext(
if (const auto thread = state.key.thread()) {
context.action = Api::SendAction(thread);
context.action->replyTo = state.currentReplyTo;
context.action->options.suggest = state.currentSuggest;
} else {
context.action = Api::SendAction(bot->owner().history(bot));
}
@@ -373,6 +374,7 @@ WebViewContext ResolveContext(
.key = (topic ? Key{ topic } : Key{ history }),
.section = (topic ? Section::Replies : Section::History),
.currentReplyTo = context.action->replyTo,
.currentSuggest = context.action->options.suggest,
};
}
return context;
@@ -2615,11 +2617,11 @@ std::unique_ptr<Ui::DropdownMenu> MakeAttachBotsMenu(
? SendMenu::Type::SilentOnly
: SendMenu::Type::Scheduled;
const auto flag = PollData::Flags();
const auto replyTo = action.replyTo;
Window::PeerMenuCreatePoll(
controller,
peer,
replyTo,
action.replyTo,
action.options.suggest,
flag,
flag,
source,
@@ -2637,11 +2639,11 @@ std::unique_ptr<Ui::DropdownMenu> MakeAttachBotsMenu(
|| action.history->peer->starsPerMessageChecked())
? SendMenu::Type::SilentOnly
: SendMenu::Type::Scheduled;
const auto replyTo = action.replyTo;
Window::PeerMenuCreateTodoList(
controller,
peer,
replyTo,
action.replyTo,
action.options.suggest,
source,
{ sendMenuType });
}, &st::menuIconCreateTodoList);