Improve class name.

This commit is contained in:
levlam 2022-12-26 23:33:01 +03:00
parent 6dcc260f2a
commit c05a6d9631
4 changed files with 23 additions and 24 deletions

View File

@ -300,18 +300,18 @@ stickerTypeMask = StickerType;
stickerTypeCustomEmoji = StickerType;
//@class StickerTypeFullInfo @description Contains full information about sticker type
//@class StickerFullType @description Contains full information about sticker type
//@description The sticker is a regular sticker @premium_animation Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker
stickerTypeFullInfoRegular premium_animation:file = StickerTypeFullInfo;
stickerFullTypeRegular premium_animation:file = StickerFullType;
//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null
stickerTypeFullInfoMask mask_position:maskPosition = StickerTypeFullInfo;
stickerFullTypeMask mask_position:maskPosition = StickerFullType;
//@description The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji
//@custom_emoji_id Identifier of the custom emoji
//@has_text_color True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places
stickerTypeFullInfoCustomEmoji custom_emoji_id:int64 has_text_color:Bool = StickerTypeFullInfo;
stickerFullTypeCustomEmoji custom_emoji_id:int64 has_text_color:Bool = StickerFullType;
//@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands
@ -382,11 +382,11 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector<photoSize> = Ph
//@height Sticker height; as defined by the sender
//@emoji Emoji corresponding to the sticker
//@format Sticker format
//@full_type Sticker full type
//@full_type Sticker's full type
//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null
//@sticker File containing the sticker
sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerTypeFullInfo outline:vector<closedVectorPath> thumbnail:thumbnail sticker:file = Sticker;
sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerFullType outline:vector<closedVectorPath> thumbnail:thumbnail sticker:file = Sticker;
//@description Describes a video file
//@duration Duration of the video, in seconds; as defined by the sender

View File

@ -1169,19 +1169,19 @@ tl_object_ptr<td_api::maskPosition> copy(const td_api::maskPosition &obj) {
}
template <>
tl_object_ptr<td_api::StickerTypeFullInfo> copy(const td_api::StickerTypeFullInfo &obj) {
tl_object_ptr<td_api::StickerFullType> copy(const td_api::StickerFullType &obj) {
switch (obj.get_id()) {
case td_api::stickerTypeFullInfoRegular::ID: {
auto &info = static_cast<const td_api::stickerTypeFullInfoRegular &>(obj);
return td_api::make_object<td_api::stickerTypeFullInfoRegular>(copy(info.premium_animation_));
case td_api::stickerFullTypeRegular::ID: {
auto &info = static_cast<const td_api::stickerFullTypeRegular &>(obj);
return td_api::make_object<td_api::stickerFullTypeRegular>(copy(info.premium_animation_));
}
case td_api::stickerTypeFullInfoMask::ID: {
auto &info = static_cast<const td_api::stickerTypeFullInfoMask &>(obj);
return td_api::make_object<td_api::stickerTypeFullInfoMask>(copy(info.mask_position_));
case td_api::stickerFullTypeMask::ID: {
auto &info = static_cast<const td_api::stickerFullTypeMask &>(obj);
return td_api::make_object<td_api::stickerFullTypeMask>(copy(info.mask_position_));
}
case td_api::stickerTypeFullInfoCustomEmoji::ID: {
auto &info = static_cast<const td_api::stickerTypeFullInfoCustomEmoji &>(obj);
return td_api::make_object<td_api::stickerTypeFullInfoCustomEmoji>(info.custom_emoji_id_, info.has_text_color_);
case td_api::stickerFullTypeCustomEmoji::ID: {
auto &info = static_cast<const td_api::stickerFullTypeCustomEmoji &>(obj);
return td_api::make_object<td_api::stickerFullTypeCustomEmoji>(info.custom_emoji_id_, info.has_text_color_);
}
default:
UNREACHABLE();

View File

@ -5387,9 +5387,8 @@ tl_object_ptr<td_api::MessageContent> get_message_content_object(const MessageCo
auto sticker = td->stickers_manager_->get_sticker_object(m->file_id);
CHECK(sticker != nullptr);
auto is_premium =
m->is_premium && sticker->full_type_->get_id() == td_api::stickerTypeFullInfoRegular::ID &&
static_cast<const td_api::stickerTypeFullInfoRegular *>(sticker->full_type_.get())->premium_animation_ !=
nullptr;
m->is_premium && sticker->full_type_->get_id() == td_api::stickerFullTypeRegular::ID &&
static_cast<const td_api::stickerFullTypeRegular *>(sticker->full_type_.get())->premium_animation_ != nullptr;
return make_tl_object<td_api::messageSticker>(std::move(sticker), is_premium);
}
case MessageContentType::Text: {

View File

@ -2214,13 +2214,13 @@ tl_object_ptr<td_api::sticker> StickersManager::get_sticker_object(FileId file_i
height *= 3;
}
}
auto full_type = [&]() -> td_api::object_ptr<td_api::StickerTypeFullInfo> {
auto full_type = [&]() -> td_api::object_ptr<td_api::StickerFullType> {
switch (sticker->type_) {
case StickerType::Regular: {
auto premium_animation_object = sticker->premium_animation_file_id_.is_valid()
? td_->file_manager_->get_file_object(sticker->premium_animation_file_id_)
: nullptr;
return td_api::make_object<td_api::stickerTypeFullInfoRegular>(std::move(premium_animation_object));
return td_api::make_object<td_api::stickerFullTypeRegular>(std::move(premium_animation_object));
}
case StickerType::Mask: {
td_api::object_ptr<td_api::maskPosition> mask_position;
@ -2228,11 +2228,11 @@ tl_object_ptr<td_api::sticker> StickersManager::get_sticker_object(FileId file_i
mask_position = td_api::make_object<td_api::maskPosition>(
get_mask_point_object(sticker->point_), sticker->x_shift_, sticker->y_shift_, sticker->scale_);
}
return td_api::make_object<td_api::stickerTypeFullInfoMask>(std::move(mask_position));
return td_api::make_object<td_api::stickerFullTypeMask>(std::move(mask_position));
}
case StickerType::CustomEmoji:
return td_api::make_object<td_api::stickerTypeFullInfoCustomEmoji>(get_custom_emoji_id(sticker->file_id_).get(),
sticker->has_text_color_);
return td_api::make_object<td_api::stickerFullTypeCustomEmoji>(get_custom_emoji_id(sticker->file_id_).get(),
sticker->has_text_color_);
default:
UNREACHABLE();
return nullptr;