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

Function ParseVoteRestrictionError

Telegram/SourceFiles/api/api_polls.cpp:76–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76[[nodiscard]] PollData::VoteRestriction ParseVoteRestrictionError(
77 const QString &type) {
78 if (MatchesErrorPattern(
79 type,
80 kSubscribersJoinedTooRecentlyVoteErrorPatterns)) {
81 return PollData::VoteRestriction::SubscribersJoinedTooRecently;
82 } else if (MatchesErrorPattern(
83 type,
84 kSubscribersOnlyVoteErrorPatterns)) {
85 return PollData::VoteRestriction::SubscribersOnly;
86 } else if (MatchesErrorPattern(
87 type,
88 kCountriesVoteErrorPatterns)) {
89 return PollData::VoteRestriction::Countries;
90 }
91 return PollData::VoteRestriction::None;
92}
93
94void ShowVoteRestrictionToast(
95 not_null<PeerData*> peer,

Callers 1

sendVotesMethod · 0.85

Calls 1

MatchesErrorPatternFunction · 0.85

Tested by

no test coverage detected