mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-03 12:58:11 +00:00
Ignore inline bot with overlapping markdown.
This commit is contained in:
parent
1b19e870c0
commit
f56d80236e
@ -341,7 +341,8 @@ bool HasSendText(not_null<const Ui::InputField*> field) {
|
||||
InlineBotQuery ParseInlineBotQuery(not_null<const Ui::InputField*> field) {
|
||||
auto result = InlineBotQuery();
|
||||
|
||||
const auto &text = field->getTextWithTags().text;
|
||||
const auto &full = field->getTextWithTags();
|
||||
const auto &text = full.text;
|
||||
const auto textLength = text.size();
|
||||
|
||||
auto inlineUsernameStart = 1;
|
||||
@ -367,6 +368,11 @@ InlineBotQuery ParseInlineBotQuery(not_null<const Ui::InputField*> field) {
|
||||
validInlineUsername = text[inlineUsernameEnd].isSpace();
|
||||
}
|
||||
if (validInlineUsername) {
|
||||
if (!full.tags.isEmpty()
|
||||
&& (full.tags.front().offset
|
||||
< inlineUsernameStart + inlineUsernameLength)) {
|
||||
return InlineBotQuery();
|
||||
}
|
||||
auto username = text.midRef(inlineUsernameStart, inlineUsernameLength);
|
||||
if (username != result.username) {
|
||||
result.username = username.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user