2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Update API scheme on layer 196.

This commit is contained in:
John Preston
2024-12-25 16:20:52 +04:00
parent e43ec6c4ea
commit 6ddf241293
14 changed files with 77 additions and 62 deletions

View File

@@ -570,6 +570,16 @@ void UserData::setVerifyDetails(Ui::VerifyDetails details) {
}
}
void UserData::setVerifyDetailsIcon(DocumentId iconId) {
if (!iconId) {
setVerifyDetails({});
} else {
auto info = _verifyDetails ? *_verifyDetails : Ui::VerifyDetails();
info.iconBgId = iconId;
setVerifyDetails(info);
}
}
const QString &UserData::phone() const {
return _phone;
}
@@ -781,6 +791,7 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
user->owner().businessInfo().applyGreetingSettings(
FromMTP(&user->owner(), update.vbusiness_greeting_message()));
}
user->setVerifyDetails(ParseVerifyDetails(update.vbot_verification()));
user->owner().stories().apply(user, update.vstories());
@@ -802,4 +813,18 @@ StarRefProgram ParseStarRefProgram(const MTPStarRefProgram *program) {
return result;
}
Ui::VerifyDetails ParseVerifyDetails(const MTPBotVerification *info) {
if (!info) {
return {};
}
const auto &data = info->data();
const auto description = qs(data.vdescription());
const auto flags = TextParseLinks;
return {
.botId = UserId(data.vbot_id().v),
.iconBgId = DocumentId(data.vicon().v),
.description = TextUtilities::ParseEntities(description, flags),
};
}
} // namespace Data