base::lambda becomes just std::function and base::lambda_once becomes
base::unique_function - a move-only wrapper around std::function.
This is required because Visual C++ 2017 15.4.1 has a compiler bug
with static member variables of class templates, they may collide.
The std::function uses inheritance and virtual functions instead of
custom vtables done by static members of class templates used in
custom base::lambda implementation, so they work fine.
Before historyPeer and historyPeerCanWrite were independent, so we
created a new Info section for both of them changing.
Now we use Data::CanWriteValue(peer) and rpl::flatten_latest().
Also don't change mask corner images when color theme is changed.
This prevents race condition in mask corner images access, because
the GIF frame readers access mask corner images from other threads.
~HistoryItem() sometimes causes a queued notification to show.
Custom notifications depend on MainWindow and it is destroyed
already in clearHistories(), so clear the notifications queue first.
Server has some extensions checking for inputMediaUploadedPhoto,
so force the extension to be .jpg anyway. It doesn't matter,
because the filename from inputFile is not used anywhere.
Also own PhotoData::UploadingData through std::unique_ptr.
Currently the build without implicitly included precompiled header
is not supported anyway (because Qt MOC source files do not include
stdafx.h, they include plain headers).
So when we decide to support building without implicitly included
precompiled headers we'll have to fix all the headers anyway.
Now each platform-dependent module declares its interface in
platform/platform_module.h file and after that includes platform-
specific headers like platform/win/module_win.h with implementation.
Also removed the legacy WinRT platform-dependent implementations.
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.