Support td_api::textEntityTypeBlockQuote.

This commit is contained in:
levlam 2023-11-09 19:15:42 +03:00 committed by David Guillen Fandos
parent 1a34273163
commit 8fe04fc33a
1 changed files with 7 additions and 2 deletions

View File

@ -580,6 +580,9 @@ class Client::JsonEntity final : public td::Jsonable {
object("custom_emoji_id", td::to_string(entity->custom_emoji_id_));
break;
}
case td_api::textEntityTypeBlockQuote::ID:
object("type", "blockquote");
break;
default:
UNREACHABLE();
}
@ -600,8 +603,7 @@ class Client::JsonVectorEntities final : public td::Jsonable {
for (auto &entity : entities_) {
auto entity_type = entity->type_->get_id();
if (entity_type != td_api::textEntityTypeBankCardNumber::ID &&
entity_type != td_api::textEntityTypeMediaTimestamp::ID &&
entity_type != td_api::textEntityTypeBlockQuote::ID) {
entity_type != td_api::textEntityTypeMediaTimestamp::ID) {
array << JsonEntity(entity.get(), client_);
}
}
@ -7946,6 +7948,9 @@ td::Result<td_api::object_ptr<td_api::TextEntityType>> Client::get_text_entity_t
TRY_RESULT(custom_emoji_id, object.get_required_long_field("custom_emoji_id"));
return make_object<td_api::textEntityTypeCustomEmoji>(custom_emoji_id);
}
if (type == "blockquote") {
return make_object<td_api::textEntityTypeBlockQuote>();
}
if (type == "mention" || type == "hashtag" || type == "cashtag" || type == "bot_command" || type == "url" ||
type == "email" || type == "phone_number" || type == "bank_card_number") {
return nullptr;