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

Replace App::self() with Auth().user().

Always have self Auth().user() when AuthSession exists.
This commit is contained in:
John Preston
2018-09-11 15:50:40 +03:00
parent 12ebae01b0
commit 0c8709ca5f
41 changed files with 227 additions and 230 deletions

View File

@@ -79,7 +79,9 @@ MainWindow::MainWindow() {
setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
subscribe(Global::RefSelfChanged(), [this] { updateGlobalMenu(); });
subscribe(Messenger::Instance().authSessionChanged(), [this] {
updateGlobalMenu();
});
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) {
themeUpdated(data);
});
@@ -277,7 +279,7 @@ void MainWindow::sendServiceHistoryRequest() {
_main->rpcFail(&MainWidget::serviceHistoryFail));
}
void MainWindow::setupMain(const MTPUser *self) {
void MainWindow::setupMain() {
Expects(AuthSession::Exists());
auto animated = (_intro || _passcodeLock);
@@ -294,7 +296,7 @@ void MainWindow::setupMain(const MTPUser *self) {
} else {
_main->activate();
}
_main->start(self);
_main->start();
fixOrder();
}
@@ -606,7 +608,7 @@ void MainWindow::updateTrayMenu(bool force) {
void MainWindow::onShowAddContact() {
if (isHidden()) showFromTray();
if (App::self()) {
if (AuthSession::Exists()) {
Ui::show(Box<AddContactBox>(), LayerOption::KeepOther);
}
}
@@ -614,7 +616,7 @@ void MainWindow::onShowAddContact() {
void MainWindow::onShowNewGroup() {
if (isHidden()) showFromTray();
if (App::self()) {
if (AuthSession::Exists()) {
Ui::show(
Box<GroupInfoBox>(CreatingGroupGroup, false),
LayerOption::KeepOther);