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

Function ApplyBotVerifierSettings

Telegram/SourceFiles/data/data_user.cpp:50–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48using UpdateFlag = Data::PeerUpdate::Flag;
49
50bool 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) {

Callers 1

setBotInfoMethod · 0.85

Calls 2

qsFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected