Special FileLoader destructor crash added to find the code path
leading to crashes that could be observed through the reports.
Looks like progress() signal handlers enter event loop somehow.
If the MTP::Instance is not started yet (we forgot our passcode),
the logout attempt was attempting to use mtproto from Intro::Widget
constructor before it was created. Now we create it before logout.
When we load previous messages in chat history we add all authors
of the messages to lastAuthors in regular groups (so that we can
suggest them in mention autocomplete). The same logic was (blindly)
applied to supergroups lastParticipants list which is used not only
for the mention autocomplete but also in Profile members list. That
way we were showing there users who could've already left the group.
Commit 8d354382a4 introduced a regression in RTL phrases display.
When an RTL line had trailing spaces we started displaying them in
front of the text still assuming counted line width value that did
not include those trailing spaces.
Line width is not including trailing spaces width because it is
allowed to fit in the line any number of spaces.
Also text block "left padding" entity was eliminated. If we have
some spaces in the start of the text block (for example a text block
after a link) we just add an empty word and mark those spaces as its
right padding.
Now base::lambda can be copied and can wrap any immutable lambda.
For mutable lambdas there is base::lambda_once (which you're
supposed to call only once to pass data through lambda captures,
for example by using std::unique_ptr). Generally base::lambda is
passed by value and base::lambda_once is passed by rvalue reference.
Some of MTP::Instance::Private fields access _instance in
destructors. All that cleanup should be performed before the
Instance::~Instance() (which invalidates _private) is called.
If we start logging in and we know, that some of the authorization
keys were read from the hard drive, not generated, we destroy all
the existing authorization keys and start generating new keys.
This will allow us to use C++14 library on all platforms.
Patches for macold versions got bigger and are now different for
crashpad and mini_chromium, so they were moved to a separate folder.
We use /SUBSYSTEM:Windows and 'MinimumRequiredVersion': '5.01' to
make our app work in Windows XP, but we use 'v140' toolset instead
of 'v140_xp' so that we have access to modern APIs like WRL.
Fix a regression introduced in 8d354382a4 which caused an overflow
in _parAnalysis access. We were resizing _parAnalysis array for a
line width without the pending newline character while we used it
for painting a line including the pending newline character. It was
not a problem before, when we were trimming them from the end of
the string, but it results in a buffer overflow and crashes in the
lastest versions. So now we just don't include the newline in the
painted string, so it has exactly the same size as _parAnalysis.
A regression was introduced in 1.0.12 version which led to wrong
activations of the main window: if a custom popup menu was shown
for the tray icon or a custom notification was clicked.
Also implement build defines for Windows
Set TELEGRAM_BUILD_DEFINES before calling gyp/refresh.bat
Fix#3000
Signed-off-by: Christoph <auer.chrisi@gmx.net>
When we hide window by 'x' title button or by cmd+w key we try to
deactivate the whole application (so some other app gets activated).
When we activate the application in any way we check if the main
window is hidden and if it is - we show it and activate it.
Sometimes the windows quiet hours registry key gets set even in
Windows 7 (or older) and we disable notifications though it has
nothing to do with real user settings. Check for 8.1 at least.