diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 1b6e78925..079edd011 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -400,6 +400,15 @@ MainWidget::MainWidget( floatPlayerClosed(itemId); }, lifetime()); + // Load current userpic and keep it loaded. + Notify::PeerUpdateValue( + session().user(), + Notify::PeerUpdate::Flag::PhotoChanged + ) | rpl::start_with_next([=] { + [[maybe_unused]] const auto image = session().user()->currentUserpic( + _selfUserpicView); + }, lifetime()); + _ptsWaiter.setRequesting(true); updateScrollColors(); setupConnectingWidget(); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 240c1c0c3..bda4ab0e6 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -38,6 +38,7 @@ struct PeerUpdate; namespace Data { class WallPaper; +class CloudImageView; } // namespace Data namespace Dialogs { @@ -107,7 +108,9 @@ class MainWidget public: using SectionShow = Window::SectionShow; - MainWidget(QWidget *parent, not_null controller); + MainWidget( + QWidget *parent, + not_null controller); [[nodiscard]] Main::Session &session() const; @@ -459,6 +462,8 @@ private: int _thirdColumnWidth = 0; Ui::Animations::Simple _a_dialogsWidth; + std::shared_ptr _selfUserpicView; + object_ptr _sideShadow; object_ptr _thirdShadow = { nullptr }; object_ptr _firstColumnResizeArea = { nullptr };