| 1287 | } |
| 1288 | |
| 1289 | void Filler::addCreatePoll() { |
| 1290 | if (skipCreateActions()) { |
| 1291 | return; |
| 1292 | } |
| 1293 | const auto can = _topic |
| 1294 | ? Data::CanSend(_topic, ChatRestriction::SendPolls) |
| 1295 | : _peer->canCreatePolls(); |
| 1296 | if (!can) { |
| 1297 | return; |
| 1298 | } |
| 1299 | const auto peer = _peer; |
| 1300 | const auto controller = _controller; |
| 1301 | const auto source = (_request.section == Section::Scheduled) |
| 1302 | ? Api::SendType::Scheduled |
| 1303 | : Api::SendType::Normal; |
| 1304 | const auto replyTo = _request.currentReplyTo; |
| 1305 | const auto sendMenuDetails = createSendMenuDetails(); |
| 1306 | const auto suggest = _request.currentSuggest; |
| 1307 | const auto chosen = kDefaultPollCreateFlags; |
| 1308 | auto callback = [=] { |
| 1309 | PeerMenuCreatePoll( |
| 1310 | controller, |
| 1311 | peer, |
| 1312 | replyTo, |
| 1313 | suggest, |
| 1314 | chosen, |
| 1315 | PollData::Flags(), |
| 1316 | source, |
| 1317 | sendMenuDetails); |
| 1318 | }; |
| 1319 | _addAction( |
| 1320 | tr::lng_polls_create(tr::now), |
| 1321 | std::move(callback), |
| 1322 | &st::menuIconCreatePoll); |
| 1323 | } |
| 1324 | |
| 1325 | void Filler::addCreateTodoList() { |
| 1326 | if (skipCreateActions()) { |
nothing calls this directly
no test coverage detected