2023-08-24 16:04:32 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
class SessionShow;
|
|
|
|
} // namespace Main
|
|
|
|
|
|
|
|
namespace Iv {
|
|
|
|
|
|
|
|
class Data;
|
|
|
|
class Shown;
|
|
|
|
|
|
|
|
class Instance final {
|
|
|
|
public:
|
|
|
|
Instance();
|
|
|
|
~Instance();
|
|
|
|
|
|
|
|
void show(
|
|
|
|
std::shared_ptr<Main::SessionShow> show,
|
|
|
|
not_null<Data*> data,
|
|
|
|
bool local);
|
|
|
|
|
|
|
|
[[nodiscard]] bool hasActiveWindow(
|
|
|
|
not_null<Main::Session*> session) const;
|
|
|
|
|
2023-12-01 14:47:24 +00:00
|
|
|
bool closeActive();
|
|
|
|
bool minimizeActive();
|
|
|
|
|
2023-08-24 16:04:32 +00:00
|
|
|
void closeAll();
|
|
|
|
|
|
|
|
[[nodiscard]] rpl::lifetime &lifetime();
|
|
|
|
|
|
|
|
private:
|
2023-12-04 19:06:44 +00:00
|
|
|
void processOpenChannel(const QString &context);
|
|
|
|
void processJoinChannel(const QString &context);
|
|
|
|
|
2023-08-24 16:04:32 +00:00
|
|
|
std::unique_ptr<Shown> _shown;
|
2023-12-04 19:06:44 +00:00
|
|
|
Main::Session *_shownSession = nullptr;
|
2023-08-24 16:04:32 +00:00
|
|
|
base::flat_set<not_null<Main::Session*>> _tracking;
|
2023-12-04 19:06:44 +00:00
|
|
|
base::flat_set<not_null<ChannelData*>> _joining;
|
2023-08-24 16:04:32 +00:00
|
|
|
|
|
|
|
rpl::lifetime _lifetime;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Iv
|