2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 23:25:15 +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

@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "numbers.h"
#include "auth_session.h"
#include "messenger.h"
namespace Ui {
@@ -4122,10 +4123,11 @@ void PhoneInput::focusInEvent(QFocusEvent *e) {
void PhoneInput::clearText() {
QString phone;
if (App::self()) {
QVector<int> newPattern = phoneNumberParse(App::self()->phone());
if (AuthSession::Exists()) {
const auto self = Auth().user();
QVector<int> newPattern = phoneNumberParse(self->phone());
if (!newPattern.isEmpty()) {
phone = App::self()->phone().mid(0, newPattern.at(0));
phone = self->phone().mid(0, newPattern.at(0));
}
}
setText(phone);