2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Remove App::app(), App::uploader(), App::api().

Also use Auth() instead of AuthSession::Current*().
This commit is contained in:
John Preston
2017-08-04 16:54:32 +02:00
parent 417f5684dc
commit ab35829358
72 changed files with 450 additions and 445 deletions

View File

@@ -146,7 +146,7 @@ void BlockedBoxController::rowActionClicked(gsl::not_null<PeerListRow*> row) {
auto user = row->peer()->asUser();
Expects(user != nullptr);
App::api()->unblockUser(user);
Auth().api().unblockUser(user);
}
void BlockedBoxController::receivedUsers(const QVector<MTPContactBlocked> &result) {
@@ -185,7 +185,7 @@ void BlockedBoxController::BlockNewUser() {
auto controller = std::make_unique<BlockUserBoxController>();
auto initBox = [controller = controller.get()](PeerListBox *box) {
controller->setBlockUserCallback([box](gsl::not_null<UserData*> user) {
App::api()->blockUser(user);
Auth().api().blockUser(user);
box->closeBox();
});
box->addButton(langFactory(lng_cancel), [box] { box->closeBox(); });
@@ -261,14 +261,14 @@ QString LastSeenPrivacyController::exceptionsDescription() {
}
void LastSeenPrivacyController::confirmSave(bool someAreDisallowed, base::lambda_once<void()> saveCallback) {
if (someAreDisallowed && !AuthSession::Current().data().lastSeenWarningSeen()) {
if (someAreDisallowed && !Auth().data().lastSeenWarningSeen()) {
auto weakBox = std::make_shared<QPointer<ConfirmBox>>();
auto callback = [weakBox, saveCallback = std::move(saveCallback)]() mutable {
if (auto box = *weakBox) {
box->closeBox();
}
saveCallback();
AuthSession::Current().data().setLastSeenWarningSeen(true);
Auth().data().setLastSeenWarningSeen(true);
Local::writeUserSettings();
};
auto box = Box<ConfirmBox>(lang(lng_edit_privacy_lastseen_warning), lang(lng_continue), lang(lng_cancel), std::move(callback));