diff --git a/Telegram/MetaStyle.vcxproj b/Telegram/MetaStyle.vcxproj index caa8bcc7bc..ebf202c782 100644 --- a/Telegram/MetaStyle.vcxproj +++ b/Telegram/MetaStyle.vcxproj @@ -102,16 +102,16 @@ <_ProjectFileVersion>11.0.60610.1 - $(SolutionDir)$(Platform)\$(Configuration)IntermediateMeta\ - $(SolutionDir)$(Platform)\$(Configuration)Meta\ + $(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\ + $(SolutionDir)$(Platform)\$(Configuration)Style\ - $(SolutionDir)$(Platform)\$(Configuration)Meta\ - $(SolutionDir)$(Platform)\$(Configuration)IntermediateMeta\ + $(SolutionDir)$(Platform)\$(Configuration)Style\ + $(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\ - $(SolutionDir)$(Platform)\$(Configuration)Meta\ - $(SolutionDir)$(Platform)\$(Configuration)IntermediateMeta\ + $(SolutionDir)$(Platform)\$(Configuration)Style\ + $(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\ diff --git a/Telegram/Resources/lang.txt b/Telegram/Resources/lang.txt index b14eb05804..e3a0101722 100644 --- a/Telegram/Resources/lang.txt +++ b/Telegram/Resources/lang.txt @@ -377,3 +377,5 @@ lng_about_text: "Unofficial free messaging app based on [a href=\"https://core.t This software is licensed under [a href=\"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\"]GNU GPL[/a] version 3, source code is available on [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a]."; lng_about_done: "Done"; + +// Keys finished diff --git a/Telegram/Setup.iss b/Telegram/Setup.iss index f50e1c3b09..77f48f59f3 100644 --- a/Telegram/Setup.iss +++ b/Telegram/Setup.iss @@ -3,9 +3,9 @@ #define MyAppShortName "Telegram" #define MyAppName "Telegram Win (Unofficial)" -#define MyAppVersion "0.5.1" -#define MyAppVersionZero "0.5.1" -#define MyAppFullVersion "0.5.1.0" +#define MyAppVersion "0.5.2" +#define MyAppVersionZero "0.5.2" +#define MyAppFullVersion "0.5.2.0" #define MyAppPublisher "Telegram (Unofficial)" #define MyAppURL "https://tdesktop.com" #define MyAppExeName "Telegram.exe" diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 0b9be11dec..6cb8f499e3 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -587,7 +587,7 @@ namespace App { break; case mtpc_contacts_myLinkEmpty: case mtpc_contacts_myLinkRequested: - if (myLink.c_contacts_myLinkRequested().vcontact.v) { + if (myLink.type() == mtpc_contacts_myLinkRequested && myLink.c_contacts_myLinkRequested().vcontact.v) { user->contact = 1; } else { switch (foreignLink.type()) { diff --git a/Telegram/SourceFiles/art/grid.png b/Telegram/SourceFiles/art/grid.png index de5e3cc653..b886b374d7 100644 Binary files a/Telegram/SourceFiles/art/grid.png and b/Telegram/SourceFiles/art/grid.png differ diff --git a/Telegram/SourceFiles/art/grid_125x.png b/Telegram/SourceFiles/art/grid_125x.png index 7b383b7bc3..40409c8b87 100644 Binary files a/Telegram/SourceFiles/art/grid_125x.png and b/Telegram/SourceFiles/art/grid_125x.png differ diff --git a/Telegram/SourceFiles/art/grid_150x.png b/Telegram/SourceFiles/art/grid_150x.png index f2242415d8..ceaa29ce48 100644 Binary files a/Telegram/SourceFiles/art/grid_150x.png and b/Telegram/SourceFiles/art/grid_150x.png differ diff --git a/Telegram/SourceFiles/art/grid_200x.png b/Telegram/SourceFiles/art/grid_200x.png index 52af2ea716..2316f49f3c 100644 Binary files a/Telegram/SourceFiles/art/grid_200x.png and b/Telegram/SourceFiles/art/grid_200x.png differ diff --git a/Telegram/SourceFiles/art/sprite_125x.png b/Telegram/SourceFiles/art/sprite_125x.png index f0e0ce6edb..ddac976c66 100644 Binary files a/Telegram/SourceFiles/art/sprite_125x.png and b/Telegram/SourceFiles/art/sprite_125x.png differ diff --git a/Telegram/SourceFiles/art/sprite_150x.png b/Telegram/SourceFiles/art/sprite_150x.png index 5f4b4febec..5e9e4ab3a3 100644 Binary files a/Telegram/SourceFiles/art/sprite_150x.png and b/Telegram/SourceFiles/art/sprite_150x.png differ diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index f274769544..845ea10e7a 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com */ #pragma once -static const int32 AppVersion = 5001; -static const wchar_t *AppVersionStr = L"0.5.1"; +static const int32 AppVersion = 5002; +static const wchar_t *AppVersionStr = L"0.5.2"; static const wchar_t *AppName = L"Telegram Win (Unofficial)"; static const wchar_t *AppId = L"{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index c68154e0a2..75666f2565 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -1063,8 +1063,11 @@ public: continue; } - bool elidedLine = _elideLast && (_y + _lineHeight >= _yTo); - if (f != j && !elidedLine) { + int32 elidedLineHeight = qMax(_lineHeight, blockHeight); + bool elidedLine = _elideLast && (_y + elidedLineHeight >= _yTo); + if (elidedLine) { + _lineHeight = elidedLineHeight; + } else if (f != j) { j = f; _wLeft = f_wLeft; _lineHeight = f_lineHeight; @@ -1088,7 +1091,11 @@ public: continue; } - bool elidedLine = _elideLast && (_y + _lineHeight >= _yTo); + int32 elidedLineHeight = qMax(_lineHeight, blockHeight); + bool elidedLine = _elideLast && (_y + elidedLineHeight >= _yTo); + if (elidedLine) { + _lineHeight = elidedLineHeight; + } if (!drawLine(elidedLine ? _blockEnd(_t, i, e) : b->from(), i, e)) return; _y += _lineHeight; _lineHeight = qMax(0, blockHeight); @@ -1536,7 +1543,7 @@ public: void elideSaveBlock(int32 blockIndex, ITextBlock *&_endBlock, int32 elideStart, int32 elideWidth) { _elideSavedIndex = blockIndex; _elideSavedBlock = _t->_blocks[blockIndex]; - const_cast(_t)->_blocks[blockIndex] = new SkipBlock(_t->_font, _t->_text, elideStart, elideWidth, _f->height, _elideSavedBlock->lnkIndex()); + const_cast(_t)->_blocks[blockIndex] = new TextBlock(_t->_font, _t->_text, QFIXED_MAX, elideStart, 0, _elideSavedBlock->flags(), _elideSavedBlock->color(), _elideSavedBlock->lnkIndex()); _blocksSize = blockIndex + 1; _endBlock = (blockIndex + 1 < _t->_blocks.size() ? _t->_blocks[blockIndex + 1] : 0); } @@ -1648,9 +1655,11 @@ public: lineLength += _Elide.size(); if (!repeat) { - for (; _t->_blocks[blockIndex] != _endBlock && _t->_blocks[blockIndex]->from() < elideStart; ++blockIndex) { + for (; blockIndex < _blocksSize && _t->_blocks[blockIndex] != _endBlock && _t->_blocks[blockIndex]->from() < elideStart; ++blockIndex) { + } + if (blockIndex < _blocksSize) { + elideSaveBlock(blockIndex, _endBlock, elideStart, elideWidth); } - elideSaveBlock(blockIndex, _endBlock, elideStart, elideWidth); } } diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 8e875c9651..a6df558062 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -439,9 +439,9 @@ namespace MTP { _localKey.setKey(key); } - void start() { + void start() { unixtimeInit(); - + if (!localKey().created()) { LOG(("App Error: trying to start MTP without local key!")); return; diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index e426c50cf2..8ae68c2132 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -81,24 +81,24 @@ namespace { volatile bool unixtimeWasSet = false; volatile uint64 _msgIdStart, _msgIdLocal = 0, _msgIdMsStart; uint32 _reqId = 0; - - void _initMsgIdConstants() { -#ifdef Q_OS_WIN - LARGE_INTEGER li; - QueryPerformanceCounter(&li); - _msgIdMsStart = li.QuadPart; -#elif defined Q_OS_MAC - _msgIdMsStart = mach_absolute_time(); -#else - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - _msgIdMsStart = 1000000000 * uint64(ts.tv_sec) + uint64(ts.tv_nsec); -#endif - uint32 msgIdRand; - memset_rand(&msgIdRand, sizeof(uint32)); - _msgIdStart = (((uint64)((uint32)unixtime()) << 32) | (uint64)msgIdRand); - } + void _initMsgIdConstants() { +#ifdef Q_OS_WIN + LARGE_INTEGER li; + QueryPerformanceCounter(&li); + _msgIdMsStart = li.QuadPart; +#elif defined Q_OS_MAC + _msgIdMsStart = mach_absolute_time(); +#else + timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + _msgIdMsStart = 1000000000 * uint64(ts.tv_sec) + uint64(ts.tv_nsec); +#endif + + uint32 msgIdRand; + memset_rand(&msgIdRand, sizeof(uint32)); + _msgIdStart = (((uint64)((uint32)unixtime()) << 32) | (uint64)msgIdRand); + } } int32 myunixtime() { @@ -106,27 +106,27 @@ int32 myunixtime() { } void unixtimeInit() { - { - QWriteLocker locker(&unixtimeLock); - unixtimeWasSet = false; - unixtimeDelta = 0; - } - _initMsgIdConstants(); + { + QWriteLocker locker(&unixtimeLock); + unixtimeWasSet = false; + unixtimeDelta = 0; + } + _initMsgIdConstants(); } void unixtimeSet(int32 serverTime, bool force) { - { - QWriteLocker locker(&unixtimeLock); - if (force) { - DEBUG_LOG(("MTP Info: forced setting client unixtime to %1").arg(serverTime)); - } else { - if (unixtimeWasSet) return; - DEBUG_LOG(("MTP Info: setting client unixtime to %1").arg(serverTime)); - } - unixtimeWasSet = true; - unixtimeDelta = serverTime + 1 - myunixtime(); - } - _initMsgIdConstants(); + { + QWriteLocker locker(&unixtimeLock); + if (force) { + DEBUG_LOG(("MTP Info: forced setting client unixtime to %1").arg(serverTime)); + } else { + if (unixtimeWasSet) return; + DEBUG_LOG(("MTP Info: setting client unixtime to %1").arg(serverTime)); + } + unixtimeWasSet = true; + unixtimeDelta = serverTime + 1 - myunixtime(); + } + _initMsgIdConstants(); } int32 unixtime() { @@ -193,7 +193,7 @@ namespace { } } }; - + void _msInitialize() { static _MsInitializer _msInitializer; } @@ -232,10 +232,10 @@ uint64 msgid() { #ifdef Q_OS_WIN LARGE_INTEGER li; QueryPerformanceCounter(&li); - int64 result = _msgIdStart + (int64)floor((li.QuadPart - _msgIdMsStart) * _msgIdCoef); + uint64 result = _msgIdStart + (uint64)floor((li.QuadPart - _msgIdMsStart) * _msgIdCoef); #elif defined Q_OS_MAC - int64 msCount = mach_absolute_time(); - int64 result = _msgIdStart + (int64)floor((msCount - _msgIdMsStart) * _msgIdCoef); + uint64 msCount = mach_absolute_time(); + uint64 result = _msgIdStart + (uint64)floor((msCount - _msgIdMsStart) * _msgIdCoef); #else uint64 result = 0; //TODO diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index fd45da3121..29ecc69167 100644 Binary files a/Telegram/Telegram.rc and b/Telegram/Telegram.rc differ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 2d830afc72..6110d47d1d 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -793,11 +793,11 @@ .\GeneratedFiles\style_classes.h - "$(SolutionDir)$(Platform)\$(Configuration)Meta\MetaStyle.exe" -classes_in ".\Resources\style_classes.txt" -classes_out ".\GeneratedFiles\style_classes.h" -styles_in ".\Resources\style.txt" -styles_out ".\GeneratedFiles\style_auto.h" + "$(SolutionDir)$(Platform)\$(Configuration)Style\MetaStyle.exe" -classes_in ".\Resources\style_classes.txt" -classes_out ".\GeneratedFiles\style_classes.h" -styles_in ".\Resources\style.txt" -styles_out ".\GeneratedFiles\style_auto.h" .\GeneratedFiles\style_auto.h - "$(SolutionDir)$(Platform)\$(Configuration)Meta\MetaStyle.exe" -classes_in ".\Resources\style_classes.txt" -classes_out ".\GeneratedFiles\style_classes.h" -styles_in ".\Resources\style.txt" -styles_out ".\GeneratedFiles\style_auto.h" + "$(SolutionDir)$(Platform)\$(Configuration)Style\MetaStyle.exe" -classes_in ".\Resources\style_classes.txt" -classes_out ".\GeneratedFiles\style_classes.h" -styles_in ".\Resources\style.txt" -styles_out ".\GeneratedFiles\style_auto.h" .\GeneratedFiles\lang.h