diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 744ec597..f220979b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -726,6 +726,9 @@ pageBlockHeader header:RichText = PageBlock; //@description A subheader @subheader Subheader pageBlockSubheader subheader:RichText = PageBlock; +//@description A kicker @kicker Kicker +pageBlockKicker kicker:RichText = PageBlock; + //@description A text paragraph @text Paragraph text pageBlockParagraph text:RichText = PageBlock; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 05ed1f8d..2eb4255c 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 5a31b90f..38ce3cef 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -502,7 +502,8 @@ class WebPagesManager::PageBlock { Collage, Slideshow, ChatLink, - Audio + Audio, + Kicker }; virtual Type get_type() const = 0; @@ -719,6 +720,38 @@ class WebPagesManager::PageBlockSubheader : public PageBlock { } }; +class WebPagesManager::PageBlockKicker : public PageBlock { + RichText kicker; + + public: + PageBlockKicker() = default; + explicit PageBlockKicker(RichText &&kicker) : kicker(std::move(kicker)) { + } + + Type get_type() const override { + return Type::Kicker; + } + + void append_file_ids(vector &file_ids) const override { + append_rich_text_file_ids(kicker, file_ids); + } + + tl_object_ptr get_page_block_object() const override { + return make_tl_object(get_rich_text_object(kicker)); + } + + template + void store(T &storer) const { + using ::td::store; + store(kicker, storer); + } + template + void parse(T &parser) { + using ::td::parse; + parse(kicker, parser); + } +}; + class WebPagesManager::PageBlockParagraph : public PageBlock { RichText text; @@ -1541,6 +1574,8 @@ void WebPagesManager::PageBlock::call_impl(Type type, const PageBlock *ptr, F && return f(static_cast(ptr)); case Type::Subheader: return f(static_cast(ptr)); + case Type::Kicker: + return f(static_cast(ptr)); case Type::Paragraph: return f(static_cast(ptr)); case Type::Preformatted: @@ -2613,6 +2648,10 @@ unique_ptr WebPagesManager::get_page_block( auto page_block = move_tl_object_as(page_block_ptr); return make_unique(get_rich_text(std::move(page_block->text_), documents)); } + case telegram_api::pageBlockKicker::ID: { + auto page_block = move_tl_object_as(page_block_ptr); + return make_unique(get_rich_text(std::move(page_block->text_), documents)); + } case telegram_api::pageBlockParagraph::ID: { auto page_block = move_tl_object_as(page_block_ptr); return make_unique(get_rich_text(std::move(page_block->text_), documents)); diff --git a/td/telegram/WebPagesManager.h b/td/telegram/WebPagesManager.h index a7c1f427..7b5e3729 100644 --- a/td/telegram/WebPagesManager.h +++ b/td/telegram/WebPagesManager.h @@ -108,6 +108,7 @@ class WebPagesManager : public Actor { class PageBlockAuthorDate; class PageBlockHeader; class PageBlockSubheader; + class PageBlockKicker; class PageBlockParagraph; class PageBlockPreformatted; class PageBlockFooter;