Compare commits

...

2 Commits

Author SHA1 Message Date
John Preston
2ab40de8b9 Alpha version 1.3.3.
- Bug fixes and other minor improvements.
2018-06-07 10:50:34 +03:00
John Preston
35659536c5 Fix first passcode unlock.
Fixes #4811.
2018-06-07 10:44:38 +03:00
12 changed files with 56 additions and 62 deletions

View File

@@ -9,7 +9,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="1.3.2.0" />
Version="1.3.3.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,2,0
PRODUCTVERSION 1,3,2,0
FILEVERSION 1,3,3,0
PRODUCTVERSION 1,3,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -52,10 +52,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.3.2.0"
VALUE "FileVersion", "1.3.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.2.0"
VALUE "ProductVersion", "1.3.3.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,2,0
PRODUCTVERSION 1,3,2,0
FILEVERSION 1,3,3,0
PRODUCTVERSION 1,3,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.3.2.0"
VALUE "FileVersion", "1.3.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.2.0"
VALUE "ProductVersion", "1.3.3.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -417,8 +417,9 @@ public:
if (range.first == range.second) {
return 0;
}
const auto result = (range.second - range.first);
impl().erase(range.first, range.second);
return (range.second - range.first);
return result;
}
iterator erase(const_iterator where) {

View File

@@ -297,8 +297,9 @@ public:
if (range.first == range.second) {
return 0;
}
const auto result = (range.second - range.first);
impl().erase(range.first, range.second);
return (range.second - range.first);
return result;
}
iterator erase(const_iterator where) {

View File

@@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 1003002;
constexpr str_const AppVersionStr = "1.3.2";
constexpr int AppVersion = 1003003;
constexpr str_const AppVersionStr = "1.3.3";
constexpr bool AppAlphaVersion = true;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View File

@@ -128,9 +128,11 @@ void MainWindow::firstShow() {
}
void MainWindow::clearWidgetsHook() {
Expects(_passcodeLock == nullptr || !Global::LocalPasscode());
auto wasMain = (_main != nullptr);
_passcodeLock.destroy();
_main.destroy();
_passcodeLock.destroy();
_intro.destroy();
if (wasMain) {
App::clearHistories();
@@ -177,18 +179,20 @@ void MainWindow::clearPasscodeLock() {
_passcodeLock.destroy();
if (_intro) {
_intro->showAnimated(bg, true);
} else {
Assert(_main != nullptr);
} else if (_main) {
_main->showAnimated(bg, true);
Messenger::Instance().checkStartUrl();
} else {
Messenger::Instance().startMtp();
if (AuthSession::Exists()) {
setupMain();
} else {
setupIntro();
}
}
}
void MainWindow::setupIntro() {
if (_intro && !_intro->isHidden() && !_main) {
return;
}
Ui::hideSettingsAndLayer(anim::type::instant);
auto animated = (_main || _passcodeLock);
@@ -273,13 +277,13 @@ void MainWindow::sendServiceHistoryRequest() {
}
void MainWindow::setupMain(const MTPUser *self) {
Expects(AuthSession::Exists());
auto animated = (_intro || _passcodeLock);
auto bg = animated ? grabInner() : QPixmap();
clearWidgets();
Assert(AuthSession::Exists());
_main.create(bodyWidget(), controller());
_main->show();
updateControlsGeometry();

View File

@@ -151,24 +151,19 @@ Messenger::Messenger(not_null<Core::Launcher*> launcher)
if (state == Local::ReadMapPassNeeded) {
Global::SetLocalPasscode(true);
Global::RefLocalPasscodeChanged().notify();
lockByPasscode();
DEBUG_LOG(("Application Info: passcode needed..."));
} else {
DEBUG_LOG(("Application Info: local map read..."));
startMtp();
}
DEBUG_LOG(("Application Info: MTP started..."));
DEBUG_LOG(("Application Info: showing."));
if (state == Local::ReadMapPassNeeded) {
lockByPasscode();
} else {
DEBUG_LOG(("Application Info: MTP started..."));
if (AuthSession::Exists()) {
_window->setupMain();
} else {
_window->setupIntro();
}
}
DEBUG_LOG(("Application Info: showing."));
_window->firstShow();
if (cStartToSettings()) {
@@ -1037,8 +1032,12 @@ void Messenger::lockByPasscode() {
}
void Messenger::unlockPasscode() {
cSetPasscodeBadTries(0);
clearPasscodeLock();
_window->clearPasscodeLock();
}
void Messenger::clearPasscodeLock() {
cSetPasscodeBadTries(0);
_passcodeLock = false;
}
@@ -1202,6 +1201,7 @@ void Messenger::loggedOut() {
Global::SetLocalPasscode(false);
Global::RefLocalPasscodeChanged().notify();
}
clearPasscodeLock();
Media::Player::mixer()->stopAndClear();
if (const auto w = getActiveWindow()) {
w->tempDirDelete(Local::ClearManagerAll);

View File

@@ -233,6 +233,7 @@ private:
void photoUpdated(const FullMsgId &msgId, const MTPInputFile &file);
void resetAuthorizationKeys();
void authSessionDestroy();
void clearPasscodeLock();
void loggedOut();
not_null<Core::Launcher*> _launcher;

View File

@@ -132,35 +132,18 @@ void PasscodeLockWidget::submit() {
return;
}
if (App::main()) {
if (Local::checkPasscode(_passcode->text().toUtf8())) {
Messenger::Instance().unlockPasscode(); // Destroys this widget.
return;
} else {
cSetPasscodeBadTries(cPasscodeBadTries() + 1);
cSetPasscodeLastTry(getms(true));
error();
return;
}
} else {
if (Local::readMap(_passcode->text().toUtf8()) != Local::ReadMapPassNeeded) {
cSetPasscodeBadTries(0);
Messenger::Instance().startMtp();
// Destroys this widget.
if (AuthSession::Exists()) {
App::wnd()->setupMain();
} else {
App::wnd()->setupIntro();
}
} else {
cSetPasscodeBadTries(cPasscodeBadTries() + 1);
cSetPasscodeLastTry(getms(true));
error();
return;
}
const auto passcode = _passcode->text().toUtf8();
const auto correct = App::main()
? Local::checkPasscode(passcode)
: (Local::readMap(passcode) != Local::ReadMapPassNeeded);
if (!correct) {
cSetPasscodeBadTries(cPasscodeBadTries() + 1);
cSetPasscodeLastTry(getms(true));
error();
return;
}
Messenger::Instance().unlockPasscode(); // Destroys this widget.
}
void PasscodeLockWidget::error() {

View File

@@ -1,6 +1,6 @@
AppVersion 1003002
AppVersion 1003003
AppVersionStrMajor 1.3
AppVersionStrSmall 1.3.2
AppVersionStr 1.3.2
AppVersionStrSmall 1.3.3
AppVersionStr 1.3.3
AlphaChannel 1
BetaVersion 0

View File

@@ -1,3 +1,7 @@
1.3.3 alpha (07.06.18)
- Bug fixes and other minor improvements.
1.3.2 alpha (07.06.18)
- Bug fixes and other minor improvements.