2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Use getters in MTP classes.

This commit is contained in:
John Preston
2019-07-05 15:38:38 +02:00
parent 3ca28c0cf9
commit 567bf60644
100 changed files with 2807 additions and 2672 deletions

View File

@@ -450,7 +450,7 @@ void ChatBackground::checkUploadWallPaper() {
result.match([&](const MTPDwallPaper &data) {
_session->data().documentConvert(
_session->data().document(documentId),
data.vdocument);
data.vdocument());
});
if (const auto paper = Data::WallPaper::Create(result)) {
setPaper(*paper);

View File

@@ -172,14 +172,13 @@ void PasscodeLockWidget::setInnerFocus() {
}
TermsLock TermsLock::FromMTP(const MTPDhelp_termsOfService &data) {
const auto minAge = data.vmin_age_confirm();
return {
bytes::make_vector(data.vid.c_dataJSON().vdata.v),
bytes::make_vector(data.vid().c_dataJSON().vdata().v),
TextWithEntities {
TextUtilities::Clean(qs(data.vtext)),
TextUtilities::EntitiesFromMTP(data.ventities.v) },
(data.has_min_age_confirm()
? base::make_optional(data.vmin_age_confirm.v)
: std::nullopt),
TextUtilities::Clean(qs(data.vtext())),
TextUtilities::EntitiesFromMTP(data.ventities().v) },
(minAge ? std::make_optional(minAge->v) : std::nullopt),
data.is_popup()
};
}

View File

@@ -841,7 +841,7 @@ void PeerMenuAddChannelMembers(not_null<ChannelData*> channel) {
list
) | ranges::view::transform([](const MTPChannelParticipant &p) {
return p.match([](const auto &data) {
return data.vuser_id.v;
return data.vuser_id().v;
});
}) | ranges::view::transform([](UserId userId) {
return Auth().data().userLoaded(userId);