mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 08:55:59 +00:00
Make notification manager creation async
This commit is contained in:
@@ -66,12 +66,23 @@ System::System()
|
||||
}
|
||||
|
||||
void System::createManager() {
|
||||
_manager = Platform::Notifications::Create(this);
|
||||
Platform::Notifications::Create(this);
|
||||
}
|
||||
|
||||
void System::setManager(std::unique_ptr<Manager> manager) {
|
||||
_manager = std::move(manager);
|
||||
if (!_manager) {
|
||||
_manager = std::make_unique<Default::Manager>(this);
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<ManagerType> System::managerType() const {
|
||||
if (_manager) {
|
||||
return _manager->type();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Main::Session *System::findSession(uint64 sessionId) const {
|
||||
for (const auto &[index, account] : Core::App().domain().accounts()) {
|
||||
if (const auto session = account->maybeSession()) {
|
||||
|
Reference in New Issue
Block a user