mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Pass MTP::Instance to MTP::Sender.
This commit is contained in:
@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "storage/localstorage.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "mainwindow.h"
|
||||
#include "apiwrap.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "history/view/history_view_cursor_state.h"
|
||||
#include "facades.h"
|
||||
@@ -130,6 +131,7 @@ GifsListWidget::GifsListWidget(
|
||||
QWidget *parent,
|
||||
not_null<Window::SessionController*> controller)
|
||||
: Inner(parent, controller)
|
||||
, _api(controller->session().api().instance())
|
||||
, _section(Section::Gifs)
|
||||
, _updateInlineItems([=] { updateInlineItems(); })
|
||||
, _previewTimer([=] { showPreview(); }) {
|
||||
@@ -217,7 +219,7 @@ GifsListWidget::~GifsListWidget() {
|
||||
void GifsListWidget::cancelGifsSearch() {
|
||||
_footer->setLoading(false);
|
||||
if (_inlineRequestId) {
|
||||
request(_inlineRequestId).cancel();
|
||||
_api.request(_inlineRequestId).cancel();
|
||||
_inlineRequestId = 0;
|
||||
}
|
||||
_inlineRequestTimer.stop();
|
||||
@@ -840,7 +842,7 @@ void GifsListWidget::searchForGifs(const QString &query) {
|
||||
if (_inlineQuery != query) {
|
||||
_footer->setLoading(false);
|
||||
if (_inlineRequestId) {
|
||||
request(_inlineRequestId).cancel();
|
||||
_api.request(_inlineRequestId).cancel();
|
||||
_inlineRequestId = 0;
|
||||
}
|
||||
if (_inlineCache.find(query) != _inlineCache.cend()) {
|
||||
@@ -855,7 +857,7 @@ void GifsListWidget::searchForGifs(const QString &query) {
|
||||
|
||||
if (!_searchBot && !_searchBotRequestId) {
|
||||
auto username = str_const_toString(kSearchBotUsername);
|
||||
_searchBotRequestId = request(MTPcontacts_ResolveUsername(
|
||||
_searchBotRequestId = _api.request(MTPcontacts_ResolveUsername(
|
||||
MTP_string(username)
|
||||
)).done([=](const MTPcontacts_ResolvedPeer &result) {
|
||||
Expects(result.type() == mtpc_contacts_resolvedPeer);
|
||||
@@ -905,7 +907,7 @@ void GifsListWidget::sendInlineRequest() {
|
||||
}
|
||||
|
||||
_footer->setLoading(true);
|
||||
_inlineRequestId = request(MTPmessages_GetInlineBotResults(
|
||||
_inlineRequestId = _api.request(MTPmessages_GetInlineBotResults(
|
||||
MTP_flags(0),
|
||||
_searchBot->inputUser,
|
||||
_inlineQueryPeer->input,
|
||||
|
Reference in New Issue
Block a user