Skip to content

Commit 47541c1

Browse files
committed
Add td_api::richTextAutoEmailAddress.
1 parent 4a385cd commit 47541c1

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

td/generate/scheme/td_api.tl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,6 +3911,9 @@ richTextEmailAddress text:RichText email_address:string = RichText;
39113911
//@description An automatically found URL @text Text
39123912
richTextAutoUrl text:RichText = RichText;
39133913

3914+
//@description An automatically found email address @text Text
3915+
richTextAutoEmailAddress text:RichText = RichText;
3916+
39143917
//@description A subscript rich text @text Text
39153918
richTextSubscript text:RichText = RichText;
39163919

td/telegram/WebPageBlock.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ class RichText {
102102
Hashtag,
103103
Cashtag,
104104
BotCommand,
105-
AutoUrl
105+
AutoUrl,
106+
AutoEmailAddress
106107
};
107108
Type type = Type::Plain;
108109
string content;
@@ -225,6 +226,8 @@ class RichText {
225226
return td_api::make_object<td_api::richTextBotCommand>(texts[0].get_rich_text_object(context));
226227
case RichText::Type::AutoUrl:
227228
return td_api::make_object<td_api::richTextAutoUrl>(texts[0].get_rich_text_object(context));
229+
case RichText::Type::AutoEmailAddress:
230+
return td_api::make_object<td_api::richTextAutoEmailAddress>(texts[0].get_rich_text_object(context));
228231
}
229232
UNREACHABLE();
230233
return nullptr;
@@ -2037,7 +2040,12 @@ RichText get_rich_text(tl_object_ptr<telegram_api::RichText> &&rich_text_ptr,
20372040
result.texts.push_back(get_rich_text(std::move(rich_text->text_), documents));
20382041
break;
20392042
}
2040-
case telegram_api::textAutoEmail::ID:
2043+
case telegram_api::textAutoEmail::ID: {
2044+
auto rich_text = telegram_api::move_object_as<telegram_api::textAutoEmail>(rich_text_ptr);
2045+
result.type = RichText::Type::AutoEmailAddress;
2046+
result.texts.push_back(get_rich_text(std::move(rich_text->text_), documents));
2047+
break;
2048+
}
20412049
case telegram_api::textAutoPhone::ID:
20422050
case telegram_api::textBankCard::ID:
20432051
case telegram_api::textMentionName::ID:

0 commit comments

Comments
 (0)