2
0
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:
John Preston
2019-11-27 11:02:56 +03:00
parent a0152557ec
commit e943264823
65 changed files with 406 additions and 275 deletions

View File

@@ -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