| 48 | using UpdateFlag = Data::PeerUpdate::Flag; |
| 49 | |
| 50 | bool ApplyBotVerifierSettings( |
| 51 | not_null<BotInfo*> info, |
| 52 | const MTPBotVerifierSettings *settings) { |
| 53 | if (!settings) { |
| 54 | const auto taken = base::take(info->verifierSettings); |
| 55 | return taken != nullptr; |
| 56 | } |
| 57 | const auto &data = settings->data(); |
| 58 | const auto parsed = BotVerifierSettings{ |
| 59 | .iconId = DocumentId(data.vicon().v), |
| 60 | .company = qs(data.vcompany()), |
| 61 | .customDescription = qs(data.vcustom_description().value_or_empty()), |
| 62 | .canModifyDescription = data.is_can_modify_custom_description(), |
| 63 | }; |
| 64 | if (!info->verifierSettings) { |
| 65 | info->verifierSettings = std::make_unique<BotVerifierSettings>( |
| 66 | parsed); |
| 67 | return true; |
| 68 | } else if (*info->verifierSettings != parsed) { |
| 69 | *info->verifierSettings = parsed; |
| 70 | return true; |
| 71 | } |
| 72 | return false; |
| 73 | } |
| 74 | |
| 75 | [[nodiscard]] Data::StarsRating ParseStarsRating( |
| 76 | const MTPStarsRating *rating) { |
no test coverage detected