diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index cb66ac534..25271f7eb 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -261,7 +261,7 @@ stickerTypeRegular = StickerType; stickerTypeMask = StickerType; //@description The sticker is a custom emoji to be used inside message text and caption -stickerTypeEmoji = StickerType; +stickerTypeCustomEmoji = StickerType; //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp index f1e355706..2da51a5a3 100644 --- a/td/telegram/InlineQueriesManager.cpp +++ b/td/telegram/InlineQueriesManager.cpp @@ -1169,8 +1169,8 @@ tl_object_ptr copy(const td_api::StickerType &obj) { return td_api::make_object(); case td_api::stickerTypeMask::ID: return td_api::make_object(); - case td_api::stickerTypeEmoji::ID: - return td_api::make_object(); + case td_api::stickerTypeCustomEmoji::ID: + return td_api::make_object(); default: UNREACHABLE(); } diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 2d469d514..23f337620 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -2716,7 +2716,7 @@ Status can_send_message_content(DialogId dialog_id, const MessageContent *conten return Status::Error(400, "Not enough rights to send stickers to the chat"); } if (td->stickers_manager_->get_sticker_type(static_cast(content)->file_id) == - StickerType::Emoji) { + StickerType::CustomEmoji) { return Status::Error(400, "Can't send emoji stickers in messages"); } break; diff --git a/td/telegram/StickerFormat.cpp b/td/telegram/StickerFormat.cpp index c0d471334..bf074aba7 100644 --- a/td/telegram/StickerFormat.cpp +++ b/td/telegram/StickerFormat.cpp @@ -147,7 +147,7 @@ bool is_sticker_format_vector(StickerFormat sticker_format) { } int64 get_max_sticker_file_size(StickerFormat sticker_format, StickerType sticker_type, bool for_thumbnail) { - bool is_emoji = sticker_type == StickerType::Emoji; + bool is_emoji = sticker_type == StickerType::CustomEmoji; switch (sticker_format) { case StickerFormat::Unknown: case StickerFormat::Webp: diff --git a/td/telegram/StickerType.cpp b/td/telegram/StickerType.cpp index 913813b45..f635242b1 100644 --- a/td/telegram/StickerType.cpp +++ b/td/telegram/StickerType.cpp @@ -17,8 +17,8 @@ StickerType get_sticker_type(const td_api::object_ptr &type return StickerType::Regular; case td_api::stickerTypeMask::ID: return StickerType::Mask; - case td_api::stickerTypeEmoji::ID: - return StickerType::Emoji; + case td_api::stickerTypeCustomEmoji::ID: + return StickerType::CustomEmoji; default: UNREACHABLE(); return StickerType::Regular; @@ -31,8 +31,8 @@ td_api::object_ptr get_sticker_type_object(StickerType stic return td_api::make_object(); case StickerType::Mask: return td_api::make_object(); - case StickerType::Emoji: - return td_api::make_object(); + case StickerType::CustomEmoji: + return td_api::make_object(); default: UNREACHABLE(); return nullptr; @@ -45,8 +45,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, StickerType sticker_typ return string_builder << "Regular"; case StickerType::Mask: return string_builder << "Mask"; - case StickerType::Emoji: - return string_builder << "Emoji"; + case StickerType::CustomEmoji: + return string_builder << "CustomEmoji"; default: UNREACHABLE(); return string_builder; diff --git a/td/telegram/StickerType.h b/td/telegram/StickerType.h index 324266052..46fa08796 100644 --- a/td/telegram/StickerType.h +++ b/td/telegram/StickerType.h @@ -14,7 +14,7 @@ namespace td { // update store_sticker/store_sticker_set when this type changes -enum class StickerType : int32 { Regular, Mask, Emoji }; +enum class StickerType : int32 { Regular, Mask, CustomEmoji }; static constexpr int32 MAX_STICKER_TYPE = 3; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 8fb4df418..bf981fe02 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -102,7 +102,7 @@ class GetAllStickersQuery final : public Td::ResultHandler { return send_query(G()->net_query_creator().create(telegram_api::messages_getAllStickers(hash))); case StickerType::Mask: return send_query(G()->net_query_creator().create(telegram_api::messages_getMaskStickers(hash))); - case StickerType::Emoji: + case StickerType::CustomEmoji: return send_query(G()->net_query_creator().create(telegram_api::messages_getEmojiStickers(hash))); default: UNREACHABLE(); @@ -283,7 +283,7 @@ class GetArchivedStickerSetsQuery final : public Td::ResultHandler { if (sticker_type_ == StickerType::Mask) { flags |= telegram_api::messages_getArchivedStickers::MASKS_MASK; } - if (sticker_type_ == StickerType::Emoji) { + if (sticker_type_ == StickerType::CustomEmoji) { flags |= telegram_api::messages_getArchivedStickers::EMOJIS_MASK; } send_query(G()->net_query_creator().create(telegram_api::messages_getArchivedStickers( @@ -319,7 +319,7 @@ class GetFeaturedStickerSetsQuery final : public Td::ResultHandler { case StickerType::Regular: send_query(G()->net_query_creator().create(telegram_api::messages_getFeaturedStickers(hash))); break; - case StickerType::Emoji: + case StickerType::CustomEmoji: send_query(G()->net_query_creator().create(telegram_api::messages_getFeaturedEmojiStickers(hash))); break; default: @@ -675,7 +675,7 @@ class ReorderStickerSetsQuery final : public Td::ResultHandler { if (sticker_type == StickerType::Mask) { flags |= telegram_api::messages_reorderStickerSets::MASKS_MASK; } - if (sticker_type == StickerType::Emoji) { + if (sticker_type == StickerType::CustomEmoji) { flags |= telegram_api::messages_reorderStickerSets::EMOJIS_MASK; } send_query(G()->net_query_creator().create(telegram_api::messages_reorderStickerSets( @@ -1039,9 +1039,9 @@ class CreateNewStickerSetQuery final : public Td::ResultHandler { if (sticker_type == StickerType::Mask) { flags |= telegram_api::stickers_createStickerSet::MASKS_MASK; } - if (sticker_type == StickerType::Emoji) { + if (sticker_type == StickerType::CustomEmoji) { // flags |= telegram_api::stickers_createStickerSet::EMOJIS_MASK; - return on_error(Status::Error(400, "Can't create emoji sets")); + return on_error(Status::Error(400, "Can't create custom emoji sets")); } if (sticker_format == StickerFormat::Tgs) { flags |= telegram_api::stickers_createStickerSet::ANIMATED_MASK; @@ -1935,7 +1935,7 @@ tl_object_ptr StickersManager::get_sticker_object(FileId file_i } } } - } else if (sticker->type == StickerType::Emoji) { + } else if (sticker->type == StickerType::CustomEmoji) { auto sticker_file_view = td_->file_manager_->get_file_view(sticker->file_id); if (!sticker_file_view.is_encrypted() && sticker_file_view.has_remote_location() && sticker_file_view.remote_location().is_document()) { @@ -2067,7 +2067,7 @@ double StickersManager::get_sticker_set_minithumbnail_zoom(const StickerSet *sti td_api::object_ptr StickersManager::get_sticker_set_thumbnail_object( const StickerSet *sticker_set) const { CHECK(sticker_set != nullptr); - if (sticker_set->thumbnail_document_id != 0 && sticker_set->sticker_type == StickerType::Emoji) { + if (sticker_set->thumbnail_document_id != 0 && sticker_set->sticker_type == StickerType::CustomEmoji) { for (auto sticker_id : sticker_set->sticker_ids) { auto file_view = td_->file_manager_->get_file_view(sticker_id); if (file_view.has_remote_location() && !file_view.remote_location().is_web() && @@ -2876,7 +2876,7 @@ void StickersManager::create_sticker(FileId file_id, FileId premium_animation_fi } else if (custom_emoji != nullptr) { s->set_id = on_get_input_sticker_set(file_id, std::move(custom_emoji->stickerset_), load_data_multipromise_ptr); s->alt = std::move(custom_emoji->alt_); - s->type = StickerType::Emoji; + s->type = StickerType::CustomEmoji; s->is_premium = !custom_emoji->free_; } s->format = format; @@ -3059,7 +3059,7 @@ StickerSetId StickersManager::on_get_sticker_set(tl_object_ptrvideos_ ? StickerFormat::Webm : (set->animated_ ? StickerFormat::Tgs : StickerFormat::Webp); StickerType sticker_type = - set->emojis_ ? StickerType::Emoji : (set->masks_ ? StickerType::Mask : StickerType::Regular); + set->emojis_ ? StickerType::CustomEmoji : (set->masks_ ? StickerType::Mask : StickerType::Regular); PhotoSize thumbnail; string minithumbnail; @@ -6696,8 +6696,8 @@ vector StickersManager::get_attached_sticker_file_ids(const vectortype == StickerType::Emoji) { - // emoji stickers can't can be attached to files + if (s->type == StickerType::CustomEmoji) { + // custom emoji stickers can't can be attached to files continue; } @@ -6796,7 +6796,7 @@ size_t StickersManager::get_max_featured_sticker_count(StickerType sticker_type) return 5; case StickerType::Mask: return 5; - case StickerType::Emoji: + case StickerType::CustomEmoji: return 16; default: UNREACHABLE(); @@ -6810,7 +6810,7 @@ Slice StickersManager::get_featured_sticker_suffix(StickerType sticker_type) { return Slice(); case StickerType::Mask: return Slice("1"); - case StickerType::Emoji: + case StickerType::CustomEmoji: return Slice("2"); default: UNREACHABLE(); @@ -7096,8 +7096,8 @@ void StickersManager::add_recent_sticker_impl(bool is_attached, FileId sticker_i if (!sticker->set_id.is_valid()) { return promise.set_error(Status::Error(400, "Stickers without sticker set can't be added to recent")); } - if (sticker->type == StickerType::Emoji) { - return promise.set_error(Status::Error(400, "Emoji stickers can't be added to recent")); + if (sticker->type == StickerType::CustomEmoji) { + return promise.set_error(Status::Error(400, "Custom emoji stickers can't be added to recent")); } auto file_view = td_->file_manager_->get_file_view(sticker_id); @@ -7481,8 +7481,8 @@ void StickersManager::add_favorite_sticker_impl(FileId sticker_id, bool add_on_s if (!sticker->set_id.is_valid()) { return promise.set_error(Status::Error(400, "Stickers without sticker set can't be added to favorite")); } - if (sticker->type == StickerType::Emoji) { - return promise.set_error(Status::Error(400, "Emoji stickers can't be added to favorite")); + if (sticker->type == StickerType::CustomEmoji) { + return promise.set_error(Status::Error(400, "Custom emoji stickers can't be added to favorite")); } auto file_view = td_->file_manager_->get_file_view(sticker_id); diff --git a/td/telegram/StickersManager.hpp b/td/telegram/StickersManager.hpp index 223fe82b9..b671a8df7 100644 --- a/td/telegram/StickersManager.hpp +++ b/td/telegram/StickersManager.hpp @@ -35,7 +35,7 @@ void StickersManager::store_sticker(FileId file_id, bool in_sticker_set, StorerT bool is_webm = sticker->format == StickerFormat::Webm; bool has_premium_animation = sticker->premium_animation_file_id.is_valid(); bool is_mask = sticker->type == StickerType::Mask; - bool is_emoji = sticker->type == StickerType::Emoji; + bool is_emoji = sticker->type == StickerType::CustomEmoji; BEGIN_STORE_FLAGS(); STORE_FLAG(is_mask); STORE_FLAG(has_sticker_set_access_hash); @@ -108,7 +108,7 @@ FileId StickersManager::parse_sticker(bool in_sticker_set, ParserT &parser) { sticker->format = StickerFormat::Webp; } if (is_emoji) { - sticker->type = StickerType::Emoji; + sticker->type = StickerType::CustomEmoji; } else if (is_mask) { sticker->type = StickerType::Mask; } else { @@ -179,7 +179,7 @@ void StickersManager::store_sticker_set(const StickerSet *sticker_set, bool with bool is_tgs = sticker_set->sticker_format == StickerFormat::Tgs; bool is_webm = sticker_set->sticker_format == StickerFormat::Webm; bool is_masks = sticker_set->sticker_type == StickerType::Mask; - bool is_emojis = sticker_set->sticker_type == StickerType::Emoji; + bool is_emojis = sticker_set->sticker_type == StickerType::CustomEmoji; bool has_thumbnail_document_id = sticker_set->thumbnail_document_id != 0; BEGIN_STORE_FLAGS(); STORE_FLAG(sticker_set->is_inited); @@ -293,7 +293,7 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser } StickerType sticker_type = StickerType::Regular; if (is_emojis) { - sticker_type = StickerType::Emoji; + sticker_type = StickerType::CustomEmoji; } else if (is_masks) { sticker_type = StickerType::Mask; } diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 8f195ec31..1017077ce 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -3320,7 +3320,7 @@ void UpdatesManager::on_update(tl_object_ptr up void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { StickerType sticker_type = StickerType::Regular; if (update->emojis_) { - sticker_type = StickerType::Emoji; + sticker_type = StickerType::CustomEmoji; } else if (update->masks_) { sticker_type = StickerType::Mask; } @@ -3337,7 +3337,7 @@ void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { - td_->stickers_manager_->reload_featured_sticker_sets(StickerType::Emoji, true); + td_->stickers_manager_->reload_featured_sticker_sets(StickerType::CustomEmoji, true); promise.set_value(Unit()); } diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index fe88311d9..cde348d1b 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -548,7 +548,7 @@ class CliClient final : public Actor { static td_api::object_ptr as_sticker_type(string sticker_type) { if (!sticker_type.empty() && sticker_type.back() == 'e') { - return td_api::make_object(); + return td_api::make_object(); } if (!sticker_type.empty() && sticker_type.back() == 'm') { return td_api::make_object();