| 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 | |
| 94 | void ShowVoteRestrictionToast( |
| 95 | not_null<PeerData*> peer, |
no test coverage detected