| 728 | } |
| 729 | |
| 730 | TextWithEntities PollVoteRestrictionText( |
| 731 | PollData::VoteRestriction restriction, |
| 732 | not_null<PeerData*> peer, |
| 733 | not_null<const PollData*> poll) { |
| 734 | switch (restriction) { |
| 735 | case PollData::VoteRestriction::SubscribersOnly: { |
| 736 | const auto channel = peer->name(); |
| 737 | return channel.isEmpty() |
| 738 | ? tr::lng_polls_vote_restricted_subscribers(tr::now, tr::rich) |
| 739 | : tr::lng_polls_vote_restricted_subscribers_channel( |
| 740 | tr::now, |
| 741 | lt_channel, |
| 742 | tr::bold(channel), |
| 743 | tr::rich); |
| 744 | } |
| 745 | case PollData::VoteRestriction::SubscribersJoinedTooRecently: |
| 746 | return tr::lng_polls_vote_restricted_subscribers_recent( |
| 747 | tr::now, |
| 748 | tr::rich); |
| 749 | case PollData::VoteRestriction::Countries: |
| 750 | return PollCountriesRestrictionText(poll->countries); |
| 751 | case PollData::VoteRestriction::None: |
| 752 | break; |
| 753 | } |
| 754 | return {}; |
| 755 | } |
no test coverage detected