| 92 | } |
| 93 | |
| 94 | void ShowVoteRestrictionToast( |
| 95 | not_null<PeerData*> peer, |
| 96 | not_null<const PollData*> poll, |
| 97 | PollData::VoteRestriction restriction) { |
| 98 | if (restriction == PollData::VoteRestriction::None) { |
| 99 | return; |
| 100 | } |
| 101 | auto text = PollVoteRestrictionText(restriction, peer, poll); |
| 102 | if (text.text.isEmpty()) { |
| 103 | return; |
| 104 | } |
| 105 | if (const auto window = peer->session().tryResolveWindow(peer)) { |
| 106 | window->showToast({ |
| 107 | .text = std::move(text), |
| 108 | .iconLottie = u"ban"_q, |
| 109 | .iconLottieSize = st::pollToastIconSize, |
| 110 | .duration = kVoteRestrictionToastDuration, |
| 111 | }); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | #ifdef _DEBUG |
| 116 | [[nodiscard]] Data::StatisticalGraph GenerateMockupPollStats( |
no test coverage detected