Remove textEntityTypeBlockQuote from public API.

GitOrigin-RevId: aa718d3c4882e6ce29545e83a6cca8168c66d35a
This commit is contained in:
levlam 2019-12-05 15:53:22 +03:00
parent 03ea8f4a70
commit ff51282a50
3 changed files with 6 additions and 9 deletions

View File

@ -70,7 +70,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity;
textEntities entities:vector<textEntity> = TextEntities; textEntities entities:vector<textEntity> = TextEntities;
//@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect each other. //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect each other.
//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough and BlockQuote entities can contain and to be contained in any other entities. All other entities can't contain each other //-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in any other entities. All other entities can't contain each other
formattedText text:string entities:vector<textEntity> = FormattedText; formattedText text:string entities:vector<textEntity> = FormattedText;
@ -1457,9 +1457,6 @@ textEntityTypeUnderline = TextEntityType;
//@description A strike-through text //@description A strike-through text
textEntityTypeStrikethrough = TextEntityType; textEntityTypeStrikethrough = TextEntityType;
//@description A block quote; this entity can't be sent for now
textEntityTypeBlockQuote = TextEntityType;
//@description Text that must be formatted as if inside a code HTML tag //@description Text that must be formatted as if inside a code HTML tag
textEntityTypeCode = TextEntityType; textEntityTypeCode = TextEntityType;

Binary file not shown.

View File

@ -104,7 +104,7 @@ tl_object_ptr<td_api::TextEntityType> MessageEntity::get_text_entity_type_object
case MessageEntity::Type::Strikethrough: case MessageEntity::Type::Strikethrough:
return make_tl_object<td_api::textEntityTypeStrikethrough>(); return make_tl_object<td_api::textEntityTypeStrikethrough>();
case MessageEntity::Type::BlockQuote: case MessageEntity::Type::BlockQuote:
return make_tl_object<td_api::textEntityTypeBlockQuote>(); return nullptr;
case MessageEntity::Type::Code: case MessageEntity::Type::Code:
return make_tl_object<td_api::textEntityTypeCode>(); return make_tl_object<td_api::textEntityTypeCode>();
case MessageEntity::Type::Pre: case MessageEntity::Type::Pre:
@ -134,7 +134,10 @@ vector<tl_object_ptr<td_api::textEntity>> get_text_entities_object(const vector<
result.reserve(entities.size()); result.reserve(entities.size());
for (auto &entity : entities) { for (auto &entity : entities) {
result.push_back(entity.get_text_entity_object()); auto entity_object = entity.get_text_entity_object();
if (entity_object->type_ != nullptr) {
result.push_back(std::move(entity_object));
}
} }
return result; return result;
@ -2096,9 +2099,6 @@ Result<vector<MessageEntity>> get_message_entities(const ContactsManager *contac
case td_api::textEntityTypeStrikethrough::ID: case td_api::textEntityTypeStrikethrough::ID:
entities.emplace_back(MessageEntity::Type::Strikethrough, entity->offset_, entity->length_); entities.emplace_back(MessageEntity::Type::Strikethrough, entity->offset_, entity->length_);
break; break;
case td_api::textEntityTypeBlockQuote::ID:
// entities.emplace_back(MessageEntity::Type::BlockQuote, entity->offset_, entity->length_);
break;
case td_api::textEntityTypeCode::ID: case td_api::textEntityTypeCode::ID:
entities.emplace_back(MessageEntity::Type::Code, entity->offset_, entity->length_); entities.emplace_back(MessageEntity::Type::Code, entity->offset_, entity->length_);
break; break;