mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Pass MTP::Instance to MTP::Sender.
This commit is contained in:
@@ -288,10 +288,11 @@ TimeId OccupiedBySomeoneTill(History *history) {
|
||||
|
||||
Helper::Helper(not_null<Main::Session*> session)
|
||||
: _session(session)
|
||||
, _api(_session->api().instance())
|
||||
, _templates(_session)
|
||||
, _reoccupyTimer([=] { reoccupy(); })
|
||||
, _checkOccupiedTimer([=] { checkOccupiedChats(); }) {
|
||||
request(MTPhelp_GetSupportName(
|
||||
_api.request(MTPhelp_GetSupportName(
|
||||
)).done([=](const MTPhelp_SupportName &result) {
|
||||
result.match([&](const MTPDhelp_supportName &data) {
|
||||
setSupportName(qs(data.vname()));
|
||||
@@ -422,7 +423,7 @@ bool Helper::isOccupiedBySomeone(History *history) const {
|
||||
}
|
||||
|
||||
void Helper::refreshInfo(not_null<UserData*> user) {
|
||||
request(MTPhelp_GetUserInfo(
|
||||
_api.request(MTPhelp_GetUserInfo(
|
||||
user->inputUser
|
||||
)).done([=](const MTPhelp_UserInfo &result) {
|
||||
applyInfo(user, result);
|
||||
@@ -531,7 +532,7 @@ void Helper::saveInfo(
|
||||
return;
|
||||
} else {
|
||||
i->second.data = text;
|
||||
request(base::take(i->second.requestId)).cancel();
|
||||
_api.request(base::take(i->second.requestId)).cancel();
|
||||
}
|
||||
} else {
|
||||
_userInfoSaving.emplace(user, SavingInfo{ text });
|
||||
@@ -545,7 +546,7 @@ void Helper::saveInfo(
|
||||
const auto entities = Api::EntitiesToMTP(
|
||||
text.entities,
|
||||
Api::ConvertOption::SkipLocal);
|
||||
_userInfoSaving[user].requestId = request(MTPhelp_EditUserInfo(
|
||||
_userInfoSaving[user].requestId = _api.request(MTPhelp_EditUserInfo(
|
||||
user->inputUser,
|
||||
MTP_string(text.text),
|
||||
entities
|
||||
|
Reference in New Issue
Block a user