Update API scheme to layer 128.

This commit is contained in:
John Preston
2021-03-30 12:16:05 +04:00
parent c7a1771dec
commit 3ec3f6484f
24 changed files with 172 additions and 202 deletions
+1 -5
View File
@@ -77,12 +77,8 @@ ChannelData::ChannelData(not_null<Data::Session*> owner, PeerId id)
}
void ChannelData::setPhoto(const MTPChatPhoto &photo) {
setPhoto(userpicPhotoId(), photo);
}
void ChannelData::setPhoto(PhotoId photoId, const MTPChatPhoto &photo) {
photo.match([&](const MTPDchatPhoto & data) {
updateUserpic(photoId, data.vdc_id().v, data.vphoto_small());
updateUserpic(data.vphoto_id().v, data.vdc_id().v);
}, [&](const MTPDchatPhotoEmpty &) {
clearUserpic();
});
+1 -3
View File
@@ -126,10 +126,8 @@ public:
ChannelData(not_null<Data::Session*> owner, PeerId id);
void setPhoto(const MTPChatPhoto &photo);
void setPhoto(PhotoId photoId, const MTPChatPhoto &photo);
void setName(const QString &name, const QString &username);
void setPhoto(const MTPChatPhoto &photo);
void setAccessHash(uint64 accessHash);
void setFlags(MTPDchannel::Flags which) {
+1 -5
View File
@@ -37,12 +37,8 @@ ChatData::ChatData(not_null<Data::Session*> owner, PeerId id)
}
void ChatData::setPhoto(const MTPChatPhoto &photo) {
setPhoto(userpicPhotoId(), photo);
}
void ChatData::setPhoto(PhotoId photoId, const MTPChatPhoto &photo) {
photo.match([&](const MTPDchatPhoto &data) {
updateUserpic(photoId, data.vdc_id().v, data.vphoto_small());
updateUserpic(data.vphoto_id().v, data.vdc_id().v);
}, [&](const MTPDchatPhotoEmpty &) {
clearUserpic();
});
+1 -3
View File
@@ -39,10 +39,8 @@ public:
ChatData(not_null<Data::Session*> owner, PeerId id);
void setPhoto(const MTPChatPhoto &photo);
void setPhoto(PhotoId photoId, const MTPChatPhoto &photo);
void setName(const QString &newName);
void setPhoto(const MTPChatPhoto &photo);
void invalidateParticipants();
[[nodiscard]] bool noParticipantInfo() const {
+6 -11
View File
@@ -377,24 +377,19 @@ Data::FileOrigin PeerData::userpicPhotoOrigin() const {
: Data::FileOrigin();
}
void PeerData::updateUserpic(
PhotoId photoId,
MTP::DcId dcId,
const MTPFileLocation &location) {
setUserpicChecked(photoId, location.match([&](
const MTPDfileLocationToBeDeprecated &deprecated) {
return ImageLocation(
void PeerData::updateUserpic(PhotoId photoId, MTP::DcId dcId) {
setUserpicChecked(
photoId,
ImageLocation(
{ StorageFileLocation(
dcId,
isSelf() ? peerToUser(id) : 0,
MTP_inputPeerPhotoFileLocation(
MTP_flags(0),
input,
deprecated.vvolume_id(),
deprecated.vlocal_id())) },
MTP_long(photoId))) },
kUserpicSize,
kUserpicSize);
}));
kUserpicSize));
}
void PeerData::clearUserpic() {
+1 -4
View File
@@ -404,10 +404,7 @@ protected:
const QString &newName,
const QString &newNameOrPhone,
const QString &newUsername);
void updateUserpic(
PhotoId photoId,
MTP::DcId dcId,
const MTPFileLocation &small);
void updateUserpic(PhotoId photoId, MTP::DcId dcId);
void clearUserpic();
private:
+1 -4
View File
@@ -72,10 +72,7 @@ void UserData::setIsContact(bool is) {
// see Serialize::readPeer as well
void UserData::setPhoto(const MTPUserProfilePhoto &photo) {
photo.match([&](const MTPDuserProfilePhoto &data) {
updateUserpic(
data.vphoto_id().v,
data.vdc_id().v,
data.vphoto_small());
updateUserpic(data.vphoto_id().v, data.vdc_id().v);
}, [&](const MTPDuserProfilePhotoEmpty &) {
clearUserpic();
});
@@ -324,6 +324,7 @@ bool Stickers::applyArchivedResultFake() {
MTP_string(raw->shortName),
MTP_vector<MTPPhotoSize>(),
MTP_int(0),
MTP_int(0),
MTP_int(raw->count),
MTP_int(raw->hash));
sets.push_back(MTP_stickerSetCovered(