mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v5.0.1' into dev
# Conflicts: # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/info/profile/info_profile_actions.cpp # Telegram/lib_ui # snap/snapcraft.yaml
This commit is contained in:
@@ -28,8 +28,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "storage/file_upload.h"
|
||||
#include "storage/storage_account.h"
|
||||
#include "storage/storage_facade.h"
|
||||
#include "data/components/recent_peers.h"
|
||||
#include "data/components/scheduled_messages.h"
|
||||
#include "data/components/sponsored_messages.h"
|
||||
#include "data/components/top_peers.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_changes.h"
|
||||
#include "data/data_user.h"
|
||||
@@ -140,8 +142,10 @@ Session::Session(
|
||||
, _giftBoxStickersPacks(std::make_unique<Stickers::GiftBoxPack>(this))
|
||||
, _sendAsPeers(std::make_unique<SendAsPeers>(this))
|
||||
, _attachWebView(std::make_unique<InlineBots::AttachWebView>(this))
|
||||
, _recentPeers(std::make_unique<Data::RecentPeers>(this))
|
||||
, _scheduledMessages(std::make_unique<Data::ScheduledMessages>(this))
|
||||
, _sponsoredMessages(std::make_unique<Data::SponsoredMessages>(this))
|
||||
, _topPeers(std::make_unique<Data::TopPeers>(this))
|
||||
, _supportHelper(Support::Helper::Create(this))
|
||||
, _saveSettingsTimer([=] { saveSettings(); }) {
|
||||
Expects(_settings != nullptr);
|
||||
@@ -491,6 +495,10 @@ void Session::uploadsStopWithConfirmation(Fn<void()> done) {
|
||||
const auto window = message
|
||||
? Core::App().windowFor(message->history()->peer)
|
||||
: Core::App().activePrimaryWindow();
|
||||
if (!window) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
auto box = Box([=](not_null<Ui::GenericBox*> box) {
|
||||
box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
@@ -533,8 +541,22 @@ auto Session::windows() const
|
||||
return _windows;
|
||||
}
|
||||
|
||||
Window::SessionController *Session::tryResolveWindow() const {
|
||||
if (_windows.empty()) {
|
||||
Window::SessionController *Session::tryResolveWindow(
|
||||
PeerData *forPeer) const {
|
||||
if (forPeer) {
|
||||
auto primary = (Window::SessionController*)nullptr;
|
||||
for (const auto &window : _windows) {
|
||||
if (window->singlePeer() == forPeer) {
|
||||
return window;
|
||||
} else if (window->isPrimary()) {
|
||||
primary = window;
|
||||
}
|
||||
}
|
||||
if (primary) {
|
||||
return primary;
|
||||
}
|
||||
}
|
||||
if (_windows.empty() || forPeer) {
|
||||
domain().activate(_account);
|
||||
if (_windows.empty()) {
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user