Fix inline bots with secondary usernames.
This commit is contained in:
parent
af5ad84e72
commit
caa1ae4436
|
@ -493,10 +493,7 @@ InlineBotQuery ParseInlineBotQuery(
|
||||||
result.lookingUpBot = true;
|
result.lookingUpBot = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result.lookingUpBot) {
|
if (result.bot
|
||||||
result.query = QString();
|
|
||||||
return result;
|
|
||||||
} else if (result.bot
|
|
||||||
&& (!result.bot->isBot()
|
&& (!result.bot->isBot()
|
||||||
|| result.bot->botInfo->inlinePlaceholder.isEmpty())) {
|
|| result.bot->botInfo->inlinePlaceholder.isEmpty())) {
|
||||||
result.bot = nullptr;
|
result.bot = nullptr;
|
||||||
|
|
|
@ -1393,9 +1393,7 @@ void HistoryWidget::updateInlineBotQuery() {
|
||||||
_inlineBotResolveRequestId = _api.request(MTPcontacts_ResolveUsername(
|
_inlineBotResolveRequestId = _api.request(MTPcontacts_ResolveUsername(
|
||||||
MTP_string(username)
|
MTP_string(username)
|
||||||
)).done([=](const MTPcontacts_ResolvedPeer &result) {
|
)).done([=](const MTPcontacts_ResolvedPeer &result) {
|
||||||
Expects(result.type() == mtpc_contacts_resolvedPeer);
|
const auto &data = result.data();
|
||||||
|
|
||||||
const auto &data = result.c_contacts_resolvedPeer();
|
|
||||||
const auto resolvedBot = [&]() -> UserData* {
|
const auto resolvedBot = [&]() -> UserData* {
|
||||||
if (const auto user = session().data().processUsers(
|
if (const auto user = session().data().processUsers(
|
||||||
data.vusers())) {
|
data.vusers())) {
|
||||||
|
@ -5198,7 +5196,7 @@ void HistoryWidget::updateFieldPlaceholder() {
|
||||||
if (!_editMsgId && _inlineBot && !_inlineLookingUpBot) {
|
if (!_editMsgId && _inlineBot && !_inlineLookingUpBot) {
|
||||||
_field->setPlaceholder(
|
_field->setPlaceholder(
|
||||||
rpl::single(_inlineBot->botInfo->inlinePlaceholder.mid(1)),
|
rpl::single(_inlineBot->botInfo->inlinePlaceholder.mid(1)),
|
||||||
_inlineBot->username().size() + 2);
|
_inlineBotUsername.size() + 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue