Add url to richTextRefernce/AnchorLink.

GitOrigin-RevId: 68d814307eb4906c0429cd6674939460b6b9173c
This commit is contained in:
levlam 2020-03-05 03:24:57 +03:00
parent cc8d876589
commit 82e43bc7eb
3 changed files with 7 additions and 6 deletions

View File

@ -843,14 +843,14 @@ richTextPhoneNumber text:RichText phone_number:string = RichText;
//@height Height of a bounding box in which the image should be shown; 0 if unknown //@height Height of a bounding box in which the image should be shown; 0 if unknown
richTextIcon document:document width:int32 height:int32 = RichText; richTextIcon document:document width:int32 height:int32 = RichText;
//@description A rich text reference of a text on the same web page @text The text @reference_text The text to show on click //@description A rich text reference of a text on the same web page @text The text @reference_text The text to show on click @url An HTTP URL, opening the reference
richTextReference text:RichText reference_text:RichText = RichText; richTextReference text:RichText reference_text:RichText url:string = RichText;
//@description An anchor @name Anchor name //@description An anchor @name Anchor name
richTextAnchor name:string = RichText; richTextAnchor name:string = RichText;
//@description A link to an anchor on the same web page @text The link text @name The anchor name //@description A link to an anchor on the same web page @text The link text @name The anchor name @url An HTTP URL, opening the anchor
richTextAnchorLink text:RichText name:string = RichText; richTextAnchorLink text:RichText name:string url:string = RichText;
//@description A concatenation of rich texts @texts Texts //@description A concatenation of rich texts @texts Texts
richTexts texts:vector<RichText> = RichText; richTexts texts:vector<RichText> = RichText;

Binary file not shown.

View File

@ -126,13 +126,14 @@ class RichText {
auto it = context->anchors_.find(anchor); auto it = context->anchors_.find(anchor);
if (it != context->anchors_.end()) { if (it != context->anchors_.end()) {
if (it->second == nullptr) { if (it->second == nullptr) {
return make_tl_object<td_api::richTextAnchorLink>(texts[0].get_rich_text_object(context), anchor.str()); return make_tl_object<td_api::richTextAnchorLink>(texts[0].get_rich_text_object(context), anchor.str(),
content);
} else { } else {
context->is_first_pass_ = true; context->is_first_pass_ = true;
auto reference_text = it->second->get_rich_text_object(context); auto reference_text = it->second->get_rich_text_object(context);
context->is_first_pass_ = false; context->is_first_pass_ = false;
return make_tl_object<td_api::richTextReference>(texts[0].get_rich_text_object(context), return make_tl_object<td_api::richTextReference>(texts[0].get_rich_text_object(context),
std::move(reference_text)); std::move(reference_text), content);
} }
} }
} }