mirror of https://github.com/procxx/kepka.git
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) {
|
InlineBotQuery ParseInlineBotQuery(not_null<const Ui::InputField*> field) {
|
||||||
auto result = InlineBotQuery();
|
auto result = InlineBotQuery();
|
||||||
|
|
||||||
const auto &text = field->getTextWithTags().text;
|
const auto &full = field->getTextWithTags();
|
||||||
|
const auto &text = full.text;
|
||||||
const auto textLength = text.size();
|
const auto textLength = text.size();
|
||||||
|
|
||||||
auto inlineUsernameStart = 1;
|
auto inlineUsernameStart = 1;
|
||||||
|
@ -367,6 +368,11 @@ InlineBotQuery ParseInlineBotQuery(not_null<const Ui::InputField*> field) {
|
||||||
validInlineUsername = text[inlineUsernameEnd].isSpace();
|
validInlineUsername = text[inlineUsernameEnd].isSpace();
|
||||||
}
|
}
|
||||||
if (validInlineUsername) {
|
if (validInlineUsername) {
|
||||||
|
if (!full.tags.isEmpty()
|
||||||
|
&& (full.tags.front().offset
|
||||||
|
< inlineUsernameStart + inlineUsernameLength)) {
|
||||||
|
return InlineBotQuery();
|
||||||
|
}
|
||||||
auto username = text.midRef(inlineUsernameStart, inlineUsernameLength);
|
auto username = text.midRef(inlineUsernameStart, inlineUsernameLength);
|
||||||
if (username != result.username) {
|
if (username != result.username) {
|
||||||
result.username = username.toString();
|
result.username = username.toString();
|
||||||
|
|
Loading…
Reference in New Issue