MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / addCreatePoll

Method addCreatePoll

Telegram/SourceFiles/window/window_peer_menu.cpp:1289–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1287}
1288
1289void 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
1325void Filler::addCreateTodoList() {
1326 if (skipCreateActions()) {

Callers

nothing calls this directly

Calls 4

CanSendFunction · 0.85
PeerMenuCreatePollFunction · 0.85
canCreatePollsMethod · 0.80
FlagsClass · 0.50

Tested by

no test coverage detected