Add has_message_content_web_page.
GitOrigin-RevId: 3bc382c77754a6a517616235d7b2572cfdfda607
This commit is contained in:
parent
36cc950820
commit
8e666c2d7a
@ -2512,11 +2512,16 @@ bool get_message_content_poll_is_anonymous(const Td *td, const MessageContent *c
|
||||
}
|
||||
}
|
||||
|
||||
void has_message_content_web_page(const MessageContent *content) {
|
||||
if (content->get_type() == MessageContentType::Text) {
|
||||
return static_cast<const MessageText *>(content)->web_page_id.is_valid();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void remove_message_content_web_page(MessageContent *content) {
|
||||
CHECK(content->get_type() == MessageContentType::Text);
|
||||
auto &web_page_id = static_cast<MessageText *>(content)->web_page_id;
|
||||
CHECK(web_page_id.is_valid());
|
||||
web_page_id = WebPageId();
|
||||
static_cast<MessageText *>(content)->web_page_id = WebPageId();
|
||||
}
|
||||
|
||||
void set_message_content_poll_answer(Td *td, const MessageContent *content, FullMessageId full_message_id,
|
||||
|
@ -135,6 +135,8 @@ bool get_message_content_poll_is_closed(const Td *td, const MessageContent *cont
|
||||
|
||||
bool get_message_content_poll_is_anonymous(const Td *td, const MessageContent *content);
|
||||
|
||||
void has_message_content_web_page(const MessageContent *content);
|
||||
|
||||
void remove_message_content_web_page(MessageContent *content);
|
||||
|
||||
void set_message_content_poll_answer(Td *td, const MessageContent *content, FullMessageId full_message_id,
|
||||
|
@ -12021,6 +12021,7 @@ void MessagesManager::delete_pending_message_web_page(FullMessageId full_message
|
||||
CHECK(m != nullptr);
|
||||
|
||||
MessageContent *content = m->content.get();
|
||||
CHECK(has_message_content_web_page(content));
|
||||
unregister_message_content(td_, content, full_message_id, "delete_pending_message_web_page");
|
||||
remove_message_content_web_page(content);
|
||||
register_message_content(td_, content, full_message_id, "delete_pending_message_web_page");
|
||||
|
Loading…
Reference in New Issue
Block a user