Improve InternalLinkMessageDraft.

This commit is contained in:
levlam 2021-05-25 19:33:39 +03:00
parent 472e0d9221
commit 5c11d7de36

View File

@ -442,6 +442,12 @@ unique_ptr<LinkManager::InternalLink> LinkManager::get_internal_link_message_dra
if (fix_formatted_text(full_text.text, full_text.entities, false, false, false, true).is_error()) {
return nullptr;
}
if (full_text.text[0] == '@') {
full_text.text = ' ' + full_text.text;
for (auto &entity : full_text.entities) {
entity.offset++;
}
}
return td::make_unique<InternalLinkMessageDraft>(std::move(full_text), contains_url);
}