diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp index 9c5b37751..475e87cb3 100644 --- a/Telegram/SourceFiles/chat_helpers/message_field.cpp +++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp @@ -493,10 +493,7 @@ InlineBotQuery ParseInlineBotQuery( result.lookingUpBot = true; } } - if (result.lookingUpBot) { - result.query = QString(); - return result; - } else if (result.bot + if (result.bot && (!result.bot->isBot() || result.bot->botInfo->inlinePlaceholder.isEmpty())) { result.bot = nullptr; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index de130e3c1..0935f0865 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1393,9 +1393,7 @@ void HistoryWidget::updateInlineBotQuery() { _inlineBotResolveRequestId = _api.request(MTPcontacts_ResolveUsername( MTP_string(username) )).done([=](const MTPcontacts_ResolvedPeer &result) { - Expects(result.type() == mtpc_contacts_resolvedPeer); - - const auto &data = result.c_contacts_resolvedPeer(); + const auto &data = result.data(); const auto resolvedBot = [&]() -> UserData* { if (const auto user = session().data().processUsers( data.vusers())) { @@ -5198,7 +5196,7 @@ void HistoryWidget::updateFieldPlaceholder() { if (!_editMsgId && _inlineBot && !_inlineLookingUpBot) { _field->setPlaceholder( rpl::single(_inlineBot->botInfo->inlinePlaceholder.mid(1)), - _inlineBot->username().size() + 2); + _inlineBotUsername.size() + 2); return; }