mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Full support and build fix.
This commit is contained in:
@@ -260,12 +260,12 @@ void PeerPhoto::clear(not_null<PhotoData*> photo) {
|
||||
};
|
||||
if (const auto chat = photo->peer->asChat()) {
|
||||
_api.request(MTPmessages_EditChatPhoto(
|
||||
chat->inputChat,
|
||||
chat->inputChat(),
|
||||
MTP_inputChatPhotoEmpty()
|
||||
)).done(applier).send();
|
||||
} else if (const auto channel = photo->peer->asChannel()) {
|
||||
_api.request(MTPchannels_EditPhoto(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_inputChatPhotoEmpty()
|
||||
)).done(applier).send();
|
||||
}
|
||||
@@ -294,7 +294,7 @@ void PeerPhoto::clear(not_null<PhotoData*> photo) {
|
||||
void PeerPhoto::clearPersonal(not_null<UserData*> user) {
|
||||
_api.request(MTPphotos_UploadContactProfilePhoto(
|
||||
MTP_flags(MTPphotos_UploadContactProfilePhoto::Flag::f_save),
|
||||
user->inputUser,
|
||||
user->inputUser(),
|
||||
MTPInputFile(),
|
||||
MTPInputFile(), // video
|
||||
MTPdouble(), // video_start_ts
|
||||
@@ -339,12 +339,12 @@ void PeerPhoto::set(not_null<PeerData*> peer, not_null<PhotoData*> photo) {
|
||||
};
|
||||
if (const auto chat = peer->asChat()) {
|
||||
_api.request(MTPmessages_EditChatPhoto(
|
||||
chat->inputChat,
|
||||
chat->inputChat(),
|
||||
MTP_inputChatPhoto(photo->mtpInput())
|
||||
)).done(applier).send();
|
||||
} else if (const auto channel = peer->asChannel()) {
|
||||
_api.request(MTPchannels_EditPhoto(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_inputChatPhoto(photo->mtpInput())
|
||||
)).done(applier).send();
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void PeerPhoto::ready(
|
||||
const auto botUserInput = [&] {
|
||||
const auto user = peer->asUser();
|
||||
return (user && user->botInfo && user->botInfo->canEditInformation)
|
||||
? std::make_optional<MTPInputUser>(user->inputUser)
|
||||
? std::make_optional<MTPInputUser>(user->inputUser())
|
||||
: std::nullopt;
|
||||
}();
|
||||
if (peer->isSelf() || botUserInput) {
|
||||
@@ -409,7 +409,7 @@ void PeerPhoto::ready(
|
||||
using Flag = MTPDinputChatUploadedPhoto::Flag;
|
||||
const auto none = MTPDinputChatUploadedPhoto::Flags(0);
|
||||
history->sendRequestId = _api.request(MTPmessages_EditChatPhoto(
|
||||
chat->inputChat,
|
||||
chat->inputChat(),
|
||||
MTP_inputChatUploadedPhoto(
|
||||
MTP_flags((file ? Flag::f_file : none)
|
||||
| (videoSize ? Flag::f_video_emoji_markup : none)),
|
||||
@@ -423,7 +423,7 @@ void PeerPhoto::ready(
|
||||
const auto none = MTPDinputChatUploadedPhoto::Flags(0);
|
||||
const auto history = _session->data().history(channel);
|
||||
history->sendRequestId = _api.request(MTPchannels_EditPhoto(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_inputChatUploadedPhoto(
|
||||
MTP_flags((file ? Flag::f_file : none)
|
||||
| (videoSize ? Flag::f_video_emoji_markup : none)),
|
||||
@@ -441,7 +441,7 @@ void PeerPhoto::ready(
|
||||
| ((type == UploadType::Suggestion)
|
||||
? Flag::f_suggest
|
||||
: Flag::f_save)),
|
||||
user->inputUser,
|
||||
user->inputUser(),
|
||||
file ? (*file) : MTPInputFile(),
|
||||
MTPInputFile(), // video
|
||||
MTPdouble(), // video_start_ts
|
||||
@@ -469,7 +469,7 @@ void PeerPhoto::requestUserPhotos(
|
||||
}
|
||||
|
||||
const auto requestId = _api.request(MTPphotos_GetUserPhotos(
|
||||
user->inputUser,
|
||||
user->inputUser(),
|
||||
MTP_int(0),
|
||||
MTP_long(afterId),
|
||||
MTP_int(kSharedMediaLimit)
|
||||
|
||||
Reference in New Issue
Block a user