Add date to user profile photos.
GitOrigin-RevId: 70ed9117d9cfc5a0e0db4746e645f2e704599a1b
This commit is contained in:
parent
78bd4b0447
commit
a4f98024a0
@ -199,8 +199,8 @@ audio duration:int32 title:string performer:string file_name:string mime_type:st
|
|||||||
//@thumbnail Document thumbnail; as defined by the sender; may be null @document File containing the document
|
//@thumbnail Document thumbnail; as defined by the sender; may be null @document File containing the document
|
||||||
document file_name:string mime_type:string thumbnail:photoSize document:file = Document;
|
document file_name:string mime_type:string thumbnail:photoSize document:file = Document;
|
||||||
|
|
||||||
//@description Describes a photo @id Photo identifier; 0 for deleted photos @has_stickers True, if stickers were added to the photo @sizes Available variants of the photo, in different sizes
|
//@description Describes a photo @has_stickers True, if stickers were added to the photo @sizes Available variants of the photo, in different sizes
|
||||||
photo id:int64 has_stickers:Bool sizes:vector<photoSize> = Photo;
|
photo has_stickers:Bool sizes:vector<photoSize> = Photo;
|
||||||
|
|
||||||
//@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender
|
//@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender
|
||||||
//@emoji Emoji corresponding to the sticker @is_mask True, if the sticker is a mask @mask_position Position where the mask should be placed; may be null @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker
|
//@emoji Emoji corresponding to the sticker @is_mask True, if the sticker is a mask @mask_position Position where the mask should be placed; may be null @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker
|
||||||
@ -288,8 +288,11 @@ user id:int32 first_name:string last_name:string username:string phone_number:st
|
|||||||
//@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot @group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user @bot_info If the user is a bot, information about the bot; may be null
|
//@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot @group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user @bot_info If the user is a bot, information about the bot; may be null
|
||||||
userFullInfo is_blocked:Bool can_be_called:Bool has_private_calls:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
|
userFullInfo is_blocked:Bool can_be_called:Bool has_private_calls:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
|
||||||
|
|
||||||
|
//@description Contains full information about a user profile photo @id Unique user profile photo identifier @added_date Point in time (Unix timestamp) when the photo has been added @sizes Available variants of the user photo, in different sizes
|
||||||
|
userProfilePhoto id:int64 added_date:int32 sizes:vector<photoSize> = UserProfilePhoto;
|
||||||
|
|
||||||
//@description Contains part of the list of user photos @total_count Total number of user profile photos @photos A list of photos
|
//@description Contains part of the list of user photos @total_count Total number of user profile photos @photos A list of photos
|
||||||
userProfilePhotos total_count:int32 photos:vector<photo> = UserProfilePhotos;
|
userProfilePhotos total_count:int32 photos:vector<userProfilePhoto> = UserProfilePhotos;
|
||||||
|
|
||||||
//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers
|
//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers
|
||||||
users total_count:int32 user_ids:vector<int32> = Users;
|
users total_count:int32 user_ids:vector<int32> = Users;
|
||||||
|
Binary file not shown.
@ -1042,7 +1042,7 @@ tl_object_ptr<td_api::document> copy(const td_api::document &obj) {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
tl_object_ptr<td_api::photo> copy(const td_api::photo &obj) {
|
tl_object_ptr<td_api::photo> copy(const td_api::photo &obj) {
|
||||||
return make_tl_object<td_api::photo>(obj.id_, obj.has_stickers_, transform(obj.sizes_, copy_photo_size));
|
return make_tl_object<td_api::photo>(obj.has_stickers_, transform(obj.sizes_, copy_photo_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -480,7 +480,20 @@ tl_object_ptr<td_api::photo> get_photo_object(FileManager *file_manager, const P
|
|||||||
photos.push_back(get_photo_size_object(file_manager, &photo_size));
|
photos.push_back(get_photo_size_object(file_manager, &photo_size));
|
||||||
}
|
}
|
||||||
sort_photo_sizes(photos);
|
sort_photo_sizes(photos);
|
||||||
return make_tl_object<td_api::photo>(photo->id, photo->has_stickers, std::move(photos));
|
return make_tl_object<td_api::photo>(photo->has_stickers, std::move(photos));
|
||||||
|
}
|
||||||
|
|
||||||
|
tl_object_ptr<td_api::userProfilePhoto> get_user_profile_photo_object(FileManager *file_manager, const Photo *photo) {
|
||||||
|
if (photo == nullptr || photo->id == -2) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<td_api::object_ptr<td_api::photoSize>> photos;
|
||||||
|
for (auto &photo_size : photo->photos) {
|
||||||
|
photos.push_back(get_photo_size_object(file_manager, &photo_size));
|
||||||
|
}
|
||||||
|
sort_photo_sizes(photos);
|
||||||
|
return make_tl_object<td_api::userProfilePhoto>(photo->id, photo->date, std::move(photos));
|
||||||
}
|
}
|
||||||
|
|
||||||
void photo_delete_thumbnail(Photo &photo) {
|
void photo_delete_thumbnail(Photo &photo) {
|
||||||
|
@ -98,6 +98,7 @@ Photo get_photo(FileManager *file_manager, tl_object_ptr<telegram_api::photo> &&
|
|||||||
Photo get_photo(FileManager *file_manager, tl_object_ptr<telegram_api::encryptedFile> &&file,
|
Photo get_photo(FileManager *file_manager, tl_object_ptr<telegram_api::encryptedFile> &&file,
|
||||||
tl_object_ptr<secret_api::decryptedMessageMediaPhoto> &&photo, DialogId owner_dialog_id);
|
tl_object_ptr<secret_api::decryptedMessageMediaPhoto> &&photo, DialogId owner_dialog_id);
|
||||||
tl_object_ptr<td_api::photo> get_photo_object(FileManager *file_manager, const Photo *photo);
|
tl_object_ptr<td_api::photo> get_photo_object(FileManager *file_manager, const Photo *photo);
|
||||||
|
tl_object_ptr<td_api::userProfilePhoto> get_user_profile_photo_object(FileManager *file_manager, const Photo *photo);
|
||||||
|
|
||||||
void photo_delete_thumbnail(Photo &photo);
|
void photo_delete_thumbnail(Photo &photo);
|
||||||
|
|
||||||
|
@ -2203,11 +2203,9 @@ class GetUserProfilePhotosRequest : public RequestActor<> {
|
|||||||
|
|
||||||
void do_send_result() override {
|
void do_send_result() override {
|
||||||
// TODO create function get_user_profile_photos_object
|
// TODO create function get_user_profile_photos_object
|
||||||
vector<tl_object_ptr<td_api::photo>> result;
|
auto result = transform(photos.second, [file_manager = td->file_manager_.get()](const Photo *photo) {
|
||||||
result.reserve(photos.second.size());
|
return get_user_profile_photo_object(file_manager, photo);
|
||||||
for (auto photo : photos.second) {
|
});
|
||||||
result.push_back(get_photo_object(td->file_manager_.get(), photo));
|
|
||||||
}
|
|
||||||
|
|
||||||
send_result(make_tl_object<td_api::userProfilePhotos>(photos.first, std::move(result)));
|
send_result(make_tl_object<td_api::userProfilePhotos>(photos.first, std::move(result)));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user