Add OnlineManager.
This commit is contained in:
parent
ccb1af5627
commit
27d1bd54dd
@ -505,6 +505,7 @@ set(TDLIB_SOURCE_PART2
|
||||
td/telegram/NotificationSettingsScope.cpp
|
||||
td/telegram/NotificationSound.cpp
|
||||
td/telegram/NotificationType.cpp
|
||||
td/telegram/OnlineManager.cpp
|
||||
td/telegram/OptionManager.cpp
|
||||
td/telegram/OrderedMessage.cpp
|
||||
td/telegram/OrderInfo.cpp
|
||||
@ -834,6 +835,7 @@ set(TDLIB_SOURCE_PART2
|
||||
td/telegram/NotificationSound.h
|
||||
td/telegram/NotificationSoundType.h
|
||||
td/telegram/NotificationType.h
|
||||
td/telegram/OnlineManager.h
|
||||
td/telegram/OptionManager.h
|
||||
td/telegram/OrderedMessage.h
|
||||
td/telegram/OrderInfo.h
|
||||
|
@ -386,6 +386,7 @@ function split_file($file, $chunks, $undo) {
|
||||
'MissingInvitee' => 'MissingInvitee',
|
||||
'notification_manager[_(-](?![.]get[(][)])|NotificationManager|notifications[)]' => 'NotificationManager',
|
||||
'notification_settings_manager[_(-](?![.]get[(][)])|NotificationSettingsManager' => 'NotificationSettingsManager',
|
||||
'online_manager[_(-](?![.]get[(][)])|OnlineManager' => 'OnlineManager',
|
||||
'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager',
|
||||
'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager',
|
||||
'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager',
|
||||
|
@ -63,6 +63,7 @@ class MessagesManager;
|
||||
class NetQueryDispatcher;
|
||||
class NotificationManager;
|
||||
class NotificationSettingsManager;
|
||||
class OnlineManager;
|
||||
class OptionManager;
|
||||
class PasswordManager;
|
||||
class PeopleNearbyManager;
|
||||
@ -407,6 +408,13 @@ class Global final : public ActorContext {
|
||||
notification_settings_manager_ = notification_settings_manager;
|
||||
}
|
||||
|
||||
ActorId<OnlineManager> online_manager() const {
|
||||
return online_manager_;
|
||||
}
|
||||
void set_online_manager(ActorId<OnlineManager> online_manager) {
|
||||
online_manager_ = online_manager;
|
||||
}
|
||||
|
||||
void set_option_manager(OptionManager *option_manager) {
|
||||
option_manager_ = option_manager;
|
||||
}
|
||||
@ -697,6 +705,7 @@ class Global final : public ActorContext {
|
||||
ActorId<MessagesManager> messages_manager_;
|
||||
ActorId<NotificationManager> notification_manager_;
|
||||
ActorId<NotificationSettingsManager> notification_settings_manager_;
|
||||
ActorId<OnlineManager> online_manager_;
|
||||
ActorId<PasswordManager> password_manager_;
|
||||
ActorId<PeopleNearbyManager> people_nearby_manager_;
|
||||
ActorId<PromoDataManager> promo_data_manager_;
|
||||
|
18
td/telegram/OnlineManager.cpp
Normal file
18
td/telegram/OnlineManager.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
||||
//
|
||||
// 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/OnlineManager.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
OnlineManager::OnlineManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) {
|
||||
}
|
||||
|
||||
void OnlineManager::tear_down() {
|
||||
parent_.reset();
|
||||
}
|
||||
|
||||
} // namespace td
|
28
td/telegram/OnlineManager.h
Normal file
28
td/telegram/OnlineManager.h
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
||||
//
|
||||
// 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 OnlineManager final : public Actor {
|
||||
public:
|
||||
OnlineManager(Td *td, ActorShared<> parent);
|
||||
|
||||
private:
|
||||
void tear_down() final;
|
||||
|
||||
Td *td_;
|
||||
ActorShared<> parent_;
|
||||
};
|
||||
|
||||
} // namespace td
|
@ -114,6 +114,7 @@
|
||||
#include "td/telegram/NotificationObjectId.h"
|
||||
#include "td/telegram/NotificationSettingsManager.h"
|
||||
#include "td/telegram/NotificationSettingsScope.h"
|
||||
#include "td/telegram/OnlineManager.h"
|
||||
#include "td/telegram/OptionManager.h"
|
||||
#include "td/telegram/PasswordManager.h"
|
||||
#include "td/telegram/Payments.h"
|
||||
@ -2696,6 +2697,7 @@ void Td::dec_actor_refcnt() {
|
||||
reset_manager(messages_manager_, "MessagesManager");
|
||||
reset_manager(notification_manager_, "NotificationManager");
|
||||
reset_manager(notification_settings_manager_, "NotificationSettingsManager");
|
||||
reset_manager(online_manager_, "OnlineManager");
|
||||
reset_manager(people_nearby_manager_, "PeopleNearbyManager");
|
||||
reset_manager(phone_number_manager_, "PhoneNumberManager");
|
||||
reset_manager(poll_manager_, "PollManager");
|
||||
@ -2875,6 +2877,7 @@ void Td::clear() {
|
||||
reset_actor(ActorOwn<Actor>(std::move(messages_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(notification_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(notification_settings_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(online_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(people_nearby_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(phone_number_manager_actor_)));
|
||||
reset_actor(ActorOwn<Actor>(std::move(poll_manager_actor_)));
|
||||
@ -3403,6 +3406,9 @@ void Td::init_managers() {
|
||||
notification_settings_manager_actor_ =
|
||||
register_actor("NotificationSettingsManager", notification_settings_manager_.get());
|
||||
G()->set_notification_settings_manager(notification_settings_manager_actor_.get());
|
||||
online_manager_ = make_unique<OnlineManager>(this, create_reference());
|
||||
online_manager_actor_ = register_actor("OnlineManager", online_manager_.get());
|
||||
G()->set_online_manager(online_manager_actor_.get());
|
||||
people_nearby_manager_ = make_unique<PeopleNearbyManager>(this, create_reference());
|
||||
people_nearby_manager_actor_ = register_actor("PeopleNearbyManager", people_nearby_manager_.get());
|
||||
G()->set_people_nearby_manager(people_nearby_manager_actor_.get());
|
||||
|
@ -75,6 +75,7 @@ class MessagesManager;
|
||||
class NetStatsManager;
|
||||
class NotificationManager;
|
||||
class NotificationSettingsManager;
|
||||
class OnlineManager;
|
||||
class OptionManager;
|
||||
class PasswordManager;
|
||||
class PeopleNearbyManager;
|
||||
@ -229,6 +230,8 @@ class Td final : public Actor {
|
||||
ActorOwn<NotificationManager> notification_manager_actor_;
|
||||
unique_ptr<NotificationSettingsManager> notification_settings_manager_;
|
||||
ActorOwn<NotificationSettingsManager> notification_settings_manager_actor_;
|
||||
unique_ptr<OnlineManager> online_manager_;
|
||||
ActorOwn<OnlineManager> online_manager_actor_;
|
||||
unique_ptr<PeopleNearbyManager> people_nearby_manager_;
|
||||
ActorOwn<PeopleNearbyManager> people_nearby_manager_actor_;
|
||||
unique_ptr<PhoneNumberManager> phone_number_manager_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user