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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user