Support General forum topic links.
This commit is contained in:
parent
374f3249be
commit
a40acdfcc3
@ -3942,7 +3942,7 @@ messageLink link:string is_public:Bool = MessageLink;
|
|||||||
//@description Contains information about a link to a message or a forum topic in a chat
|
//@description Contains information about a link to a message or a forum topic in a chat
|
||||||
//@is_public True, if the link is a public link for a message in a chat
|
//@is_public True, if the link is a public link for a message in a chat
|
||||||
//@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise
|
//@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise
|
||||||
//@message_thread_id If found, identifier of the message thread in which to open the message, or which to open if the message is missing
|
//@message_thread_id If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing
|
||||||
//@message If found, the linked message; may be null
|
//@message If found, the linked message; may be null
|
||||||
//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
|
//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
|
||||||
//@for_album True, if the whole media album to which the message belongs is linked
|
//@for_album True, if the whole media album to which the message belongs is linked
|
||||||
|
@ -19620,6 +19620,10 @@ td_api::object_ptr<td_api::messageLinkInfo> MessagesManager::get_message_link_in
|
|||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
dialog_id = DialogId();
|
dialog_id = DialogId();
|
||||||
top_thread_message_id = MessageId();
|
top_thread_message_id = MessageId();
|
||||||
|
} else if (message_id == MessageId(ServerMessageId(1)) && dialog_id.get_type() == DialogType::Channel &&
|
||||||
|
td_->contacts_manager_->is_forum_channel(dialog_id.get_channel_id())) {
|
||||||
|
// General topic
|
||||||
|
top_thread_message_id = message_id;
|
||||||
} else {
|
} else {
|
||||||
const Message *m = get_message(d, message_id);
|
const Message *m = get_message(d, message_id);
|
||||||
if (m != nullptr) {
|
if (m != nullptr) {
|
||||||
@ -19636,7 +19640,7 @@ td_api::object_ptr<td_api::messageLinkInfo> MessagesManager::get_message_link_in
|
|||||||
media_timestamp = info.media_timestamp;
|
media_timestamp = info.media_timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m->content->get_type() == MessageContentType::TopicCreate && m->top_thread_message_id.is_valid()) {
|
if (m->content->get_type() == MessageContentType::TopicCreate && top_thread_message_id.is_valid()) {
|
||||||
message = nullptr;
|
message = nullptr;
|
||||||
CHECK(!for_album);
|
CHECK(!for_album);
|
||||||
CHECK(media_timestamp == 0);
|
CHECK(media_timestamp == 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user