From 1e6c1dbb12a1a05e074270d06b964f966279f2e2 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 11 Mar 2024 01:08:29 +0300 Subject: [PATCH] Add empty PeopleNearbyManager. --- CMakeLists.txt | 2 ++ SplitSource.php | 1 + td/telegram/Global.h | 9 +++++++++ td/telegram/PeopleNearbyManager.cpp | 18 ++++++++++++++++++ td/telegram/PeopleNearbyManager.h | 28 ++++++++++++++++++++++++++++ td/telegram/Td.cpp | 6 ++++++ td/telegram/Td.h | 3 +++ 7 files changed, 67 insertions(+) create mode 100644 td/telegram/PeopleNearbyManager.cpp create mode 100644 td/telegram/PeopleNearbyManager.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 90d1ddb63..3f1e9681a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -459,6 +459,7 @@ set(TDLIB_SOURCE td/telegram/PasswordManager.cpp td/telegram/Payments.cpp td/telegram/PeerColor.cpp + td/telegram/PeopleNearbyManager.cpp td/telegram/PhoneNumberManager.cpp td/telegram/Photo.cpp td/telegram/PhotoSize.cpp @@ -790,6 +791,7 @@ set(TDLIB_SOURCE td/telegram/PasswordManager.h td/telegram/Payments.h td/telegram/PeerColor.h + td/telegram/PeopleNearbyManager.h td/telegram/PhoneNumberManager.h td/telegram/Photo.h td/telegram/PhotoFormat.h diff --git a/SplitSource.php b/SplitSource.php index b9132f035..a52e6809e 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -374,6 +374,7 @@ function split_file($file, $chunks, $undo) { 'notification_settings_manager[_(-](?![.]get[(][)])|NotificationSettingsManager' => 'NotificationSettingsManager', 'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager', 'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager', + 'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager', '[a-z_]*phone_number_manager[_(-](?![.]get[(][)])|PhoneNumberManager' => 'PhoneNumberManager', 'PhotoSizeSource' => 'PhotoSizeSource', 'poll_manager[_(-](?![.]get[(][)])|PollManager' => 'PollManager', diff --git a/td/telegram/Global.h b/td/telegram/Global.h index a2b296351..187c1fd13 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -62,6 +62,7 @@ class NotificationManager; class NotificationSettingsManager; class OptionManager; class PasswordManager; +class PeopleNearbyManager; class QuickReplyManager; class ReactionManager; class SavedMessagesManager; @@ -391,6 +392,13 @@ class Global final : public ActorContext { password_manager_ = password_manager; } + ActorId people_nearby_manager() const { + return people_nearby_manager_; + } + void set_people_nearby_manager(ActorId people_nearby_manager) { + people_nearby_manager_ = people_nearby_manager; + } + ActorId quick_reply_manager() const { return quick_reply_manager_; } @@ -637,6 +645,7 @@ class Global final : public ActorContext { ActorId notification_manager_; ActorId notification_settings_manager_; ActorId password_manager_; + ActorId people_nearby_manager_; ActorId quick_reply_manager_; ActorId reaction_manager_; ActorId saved_messages_manager_; diff --git a/td/telegram/PeopleNearbyManager.cpp b/td/telegram/PeopleNearbyManager.cpp new file mode 100644 index 000000000..fc6e53b9d --- /dev/null +++ b/td/telegram/PeopleNearbyManager.cpp @@ -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/PeopleNearbyManager.h" + +namespace td { + +PeopleNearbyManager::PeopleNearbyManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void PeopleNearbyManager::tear_down() { + parent_.reset(); +} + +} // namespace td diff --git a/td/telegram/PeopleNearbyManager.h b/td/telegram/PeopleNearbyManager.h new file mode 100644 index 000000000..49a245104 --- /dev/null +++ b/td/telegram/PeopleNearbyManager.h @@ -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 PeopleNearbyManager final : public Actor { + public: + PeopleNearbyManager(Td *td, ActorShared<> parent); + + private: + void tear_down() final; + + Td *td_; + ActorShared<> parent_; +}; + +} // namespace td diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 4d361f23e..56f3a796d 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -114,6 +114,7 @@ #include "td/telegram/OptionManager.h" #include "td/telegram/PasswordManager.h" #include "td/telegram/Payments.h" +#include "td/telegram/PeopleNearbyManager.h" #include "td/telegram/PhoneNumberManager.h" #include "td/telegram/PhotoSizeSource.h" #include "td/telegram/PollManager.h" @@ -3229,6 +3230,7 @@ void Td::dec_actor_refcnt() { reset_manager(messages_manager_, "MessagesManager"); reset_manager(notification_manager_, "NotificationManager"); reset_manager(notification_settings_manager_, "NotificationSettingsManager"); + reset_manager(people_nearby_manager_, "PeopleNearbyManager"); reset_manager(poll_manager_, "PollManager"); reset_manager(privacy_manager_, "PrivacyManager"); reset_manager(quick_reply_manager_, "QuickReplyManager"); @@ -3401,6 +3403,7 @@ void Td::clear() { reset_actor(ActorOwn(std::move(messages_manager_actor_))); reset_actor(ActorOwn(std::move(notification_manager_actor_))); reset_actor(ActorOwn(std::move(notification_settings_manager_actor_))); + reset_actor(ActorOwn(std::move(people_nearby_manager_actor_))); reset_actor(ActorOwn(std::move(poll_manager_actor_))); reset_actor(ActorOwn(std::move(privacy_manager_actor_))); reset_actor(ActorOwn(std::move(quick_reply_manager_actor_))); @@ -3926,6 +3929,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()); + people_nearby_manager_ = make_unique(this, create_reference()); + people_nearby_manager_actor_ = register_actor("PeopleNearbyManager", people_nearby_manager_.get()); + G()->set_people_nearby_manager(people_nearby_manager_actor_.get()); poll_manager_ = make_unique(this, create_reference()); poll_manager_actor_ = register_actor("PollManager", poll_manager_.get()); privacy_manager_ = make_unique(this, create_reference()); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index ac0ccb062..8014cf8b8 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -77,6 +77,7 @@ class NotificationManager; class NotificationSettingsManager; class OptionManager; class PasswordManager; +class PeopleNearbyManager; class PhoneNumberManager; class PollManager; class PrivacyManager; @@ -224,6 +225,8 @@ class Td final : public Actor { ActorOwn poll_manager_actor_; unique_ptr privacy_manager_; ActorOwn privacy_manager_actor_; + unique_ptr people_nearby_manager_; + ActorOwn people_nearby_manager_actor_; unique_ptr quick_reply_manager_; ActorOwn quick_reply_manager_actor_; unique_ptr reaction_manager_;