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

Function PollVoteRestrictionText

Telegram/SourceFiles/data/data_poll.cpp:730–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730TextWithEntities 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}

Callers 2

ShowVoteRestrictionToastFunction · 0.85

Calls 3

nameMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected