Add TimeZoneManager.
This commit is contained in:
parent
dc2300d7ae
commit
552e6ba35a
@ -509,6 +509,7 @@ set(TDLIB_SOURCE
|
||||
td/telegram/TdDb.cpp
|
||||
td/telegram/TermsOfService.cpp
|
||||
td/telegram/ThemeManager.cpp
|
||||
td/telegram/TimeZoneManager.cpp
|
||||
td/telegram/TopDialogCategory.cpp
|
||||
td/telegram/TopDialogManager.cpp
|
||||
td/telegram/TranscriptionInfo.cpp
|
||||
@ -846,6 +847,7 @@ set(TDLIB_SOURCE
|
||||
td/telegram/TdDb.h
|
||||
td/telegram/TermsOfService.h
|
||||
td/telegram/ThemeManager.h
|
||||
td/telegram/TimeZoneManager.h
|
||||
td/telegram/TopDialogCategory.h
|
||||
td/telegram/TopDialogManager.h
|
||||
td/telegram/TranscriptionInfo.h
|
||||
|
@ -396,6 +396,7 @@ function split_file($file, $chunks, $undo) {
|
||||
'td_db[(][)]|TdDb[^A-Za-z]' => 'TdDb',
|
||||
'telegram_api' => 'telegram_api',
|
||||
'theme_manager[_(-](?![.]get[(][)])|ThemeManager' => 'ThemeManager',
|
||||
'time_zone_manager[_(-](?![.]get[(][)])|TimeZoneManager' => 'TimeZoneManager',
|
||||
'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory',
|
||||
'top_dialog_manager[_(-](?![.]get[(][)])|TopDialogManager' => 'TopDialogManager',
|
||||
'translation_manager[_(-](?![.]get[(][)])|TranslationManager' => 'TranslationManager',
|
||||
|
@ -73,6 +73,7 @@ class Td;
|
||||
class TdDb;
|
||||
class TempAuthKeyWatchdog;
|
||||
class ThemeManager;
|
||||
class TimeZoneManager;
|
||||
class TopDialogManager;
|
||||
class TranscriptionManager;
|
||||
class UpdatesManager;
|
||||
@ -437,6 +438,13 @@ class Global final : public ActorContext {
|
||||
theme_manager_ = theme_manager;
|
||||
}
|
||||
|
||||
ActorId<TimeZoneManager> time_zone_manager() const {
|
||||
return time_zone_manager_;
|
||||
}
|
||||
void set_time_zone_manager(ActorId<TimeZoneManager> time_zone_manager) {
|
||||
time_zone_manager_ = time_zone_manager;
|
||||
}
|
||||
|
||||
ActorId<TopDialogManager> top_dialog_manager() const {
|
||||
return top_dialog_manager_;
|
||||
}
|
||||
@ -620,6 +628,7 @@ class Global final : public ActorContext {
|
||||
ActorId<StorageManager> storage_manager_;
|
||||
ActorId<StoryManager> story_manager_;
|
||||
ActorId<ThemeManager> theme_manager_;
|
||||
ActorId<TimeZoneManager> time_zone_manager_;
|
||||
ActorId<TopDialogManager> top_dialog_manager_;
|
||||
ActorId<TranscriptionManager> transcription_manager_;
|
||||
ActorId<UpdatesManager> updates_manager_;
|
||||
|
@ -146,6 +146,7 @@
|
||||
#include "td/telegram/TdDb.h"
|
||||
#include "td/telegram/telegram_api.h"
|
||||
#include "td/telegram/ThemeManager.h"
|
||||
#include "td/telegram/TimeZoneManager.h"
|
||||
#include "td/telegram/TopDialogCategory.h"
|
||||
#include "td/telegram/TopDialogManager.h"
|
||||
#include "td/telegram/TranscriptionManager.h"
|
||||
@ -3229,6 +3230,7 @@ void Td::dec_actor_refcnt() {
|
||||
reset_manager(stickers_manager_, "StickersManager");
|
||||
reset_manager(story_manager_, "StoryManager");
|
||||
reset_manager(theme_manager_, "ThemeManager");
|
||||
reset_manager(time_zone_manager_, "TimeZoneManager");
|
||||
reset_manager(top_dialog_manager_, "TopDialogManager");
|
||||
reset_manager(transcription_manager_, "TranscriptionManager");
|
||||
reset_manager(translation_manager_, "TranslationManager");
|
||||
@ -3398,6 +3400,7 @@ void Td::clear() {
|
||||
reset_actor(ActorOwn<Actor>(std::move(stickers_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(story_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(theme_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(time_zone_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(top_dialog_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(transcription_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(translation_manager_actor_)));
|
||||
@ -3933,6 +3936,9 @@ void Td::init_managers() {
|
||||
theme_manager_ = make_unique<ThemeManager>(this, create_reference());
|
||||
theme_manager_actor_ = register_actor("ThemeManager", theme_manager_.get());
|
||||
G()->set_theme_manager(theme_manager_actor_.get());
|
||||
time_zone_manager_ = make_unique<TimeZoneManager>(this, create_reference());
|
||||
time_zone_manager_actor_ = register_actor("TimeZoneManager", time_zone_manager_.get());
|
||||
G()->set_time_zone_manager(time_zone_manager_actor_.get());
|
||||
top_dialog_manager_ = make_unique<TopDialogManager>(this, create_reference());
|
||||
top_dialog_manager_actor_ = register_actor("TopDialogManager", top_dialog_manager_.get());
|
||||
G()->set_top_dialog_manager(top_dialog_manager_actor_.get());
|
||||
|
@ -90,6 +90,7 @@ class StickersManager;
|
||||
class StorageManager;
|
||||
class StoryManager;
|
||||
class ThemeManager;
|
||||
class TimeZoneManager;
|
||||
class TopDialogManager;
|
||||
class TranscriptionManager;
|
||||
class TranslationManager;
|
||||
@ -233,6 +234,8 @@ class Td final : public Actor {
|
||||
ActorOwn<StoryManager> story_manager_actor_;
|
||||
unique_ptr<ThemeManager> theme_manager_;
|
||||
ActorOwn<ThemeManager> theme_manager_actor_;
|
||||
unique_ptr<TimeZoneManager> time_zone_manager_;
|
||||
ActorOwn<TimeZoneManager> time_zone_manager_actor_;
|
||||
unique_ptr<TopDialogManager> top_dialog_manager_;
|
||||
ActorOwn<TopDialogManager> top_dialog_manager_actor_;
|
||||
unique_ptr<TranscriptionManager> transcription_manager_;
|
||||
|
18
td/telegram/TimeZoneManager.cpp
Normal file
18
td/telegram/TimeZoneManager.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#include "td/telegram/TimeZoneManager.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
TimeZoneManager::TimeZoneManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) {
|
||||
}
|
||||
|
||||
void TimeZoneManager::tear_down() {
|
||||
parent_.reset();
|
||||
}
|
||||
|
||||
} // namespace td
|
28
td/telegram/TimeZoneManager.h
Normal file
28
td/telegram/TimeZoneManager.h
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
|
||||
#include "td/utils/common.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
class Td;
|
||||
|
||||
class TimeZoneManager final : public Actor {
|
||||
public:
|
||||
TimeZoneManager(Td *td, ActorShared<> parent);
|
||||
|
||||
private:
|
||||
void tear_down() final;
|
||||
|
||||
Td *td_;
|
||||
ActorShared<> parent_;
|
||||
};
|
||||
|
||||
} // namespace td
|
Loading…
Reference in New Issue
Block a user