2
0
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:
Ilya Fedin
2021-01-21 14:18:40 +04:00
committed by John Preston
parent a0a71687e7
commit e8edbb16ae
10 changed files with 152 additions and 82 deletions

View File

@@ -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()) {