Add empty BusinessConnectionManager.

This commit is contained in:
levlam 2024-03-07 15:44:15 +03:00
parent bce17cb5d8
commit bb683c2988
7 changed files with 67 additions and 0 deletions

View File

@ -304,6 +304,7 @@ set(TDLIB_SOURCE
td/telegram/BusinessAwayMessage.cpp
td/telegram/BusinessAwayMessageSchedule.cpp
td/telegram/BusinessConnectedBot.cpp
td/telegram/BusinessConnectionManager.cpp
td/telegram/BusinessGreetingMessage.cpp
td/telegram/BusinessInfo.cpp
td/telegram/BusinessManager.cpp
@ -592,6 +593,7 @@ set(TDLIB_SOURCE
td/telegram/BusinessAwayMessage.h
td/telegram/BusinessAwayMessageSchedule.h
td/telegram/BusinessConnectedBot.h
td/telegram/BusinessConnectionManager.h
td/telegram/BusinessGreetingMessage.h
td/telegram/BusinessInfo.h
td/telegram/BusinessManager.h

View File

@ -311,6 +311,7 @@ function split_file($file, $chunks, $undo) {
'bot_info_manager[_(-](?![.]get[(][)])|BotInfoManager' => 'BotInfoManager',
'BusinessAwayMessage' => 'BusinessAwayMessage',
'BusinessConnectedBot' => 'BusinessConnectedBot',
'business_connection_manager[_(-](?![.]get[(][)])|BusinessConnectionManager' => 'BusinessConnectionManager',
'BusinessGreetingMessage' => 'BusinessGreetingMessage',
'BusinessInfo|business_info' => 'BusinessInfo',
'business_manager[_(-](?![.]get[(][)])|BusinessManager' => 'BusinessManager',

View 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/BusinessConnectionManager.h"
namespace td {
BusinessConnectionManager::BusinessConnectionManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) {
}
void BusinessConnectionManager::tear_down() {
parent_.reset();
}
} // namespace td

View 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 BusinessConnectionManager final : public Actor {
public:
BusinessConnectionManager(Td *td, ActorShared<> parent);
private:
void tear_down() final;
Td *td_;
ActorShared<> parent_;
};
} // namespace td

View File

@ -37,6 +37,7 @@ class AuthManager;
class AutosaveManager;
class BackgroundManager;
class BoostManager;
class BusinessConnectionManager;
class BusinessManager;
class CallManager;
class ConfigManager;
@ -233,6 +234,13 @@ class Global final : public ActorContext {
boost_manager_ = boost_manager;
}
ActorId<BusinessConnectionManager> business_connection_manager() const {
return business_connection_manager_;
}
void set_business_connection_manager(ActorId<BusinessConnectionManager> business_connection_manager) {
business_connection_manager_ = business_connection_manager;
}
ActorId<BusinessManager> business_manager() const {
return business_manager_;
}
@ -623,6 +631,7 @@ class Global final : public ActorContext {
ActorId<AutosaveManager> autosave_manager_;
ActorId<BackgroundManager> background_manager_;
ActorId<BoostManager> boost_manager_;
ActorId<BusinessConnectionManager> business_connection_manager_;
ActorId<BusinessManager> business_manager_;
ActorId<CallManager> call_manager_;
ActorId<ConfigManager> config_manager_;

View File

@ -23,6 +23,7 @@
#include "td/telegram/BotInfoManager.h"
#include "td/telegram/BotMenuButton.h"
#include "td/telegram/BusinessAwayMessage.h"
#include "td/telegram/BusinessConnectionManager.h"
#include "td/telegram/BusinessGreetingMessage.h"
#include "td/telegram/BusinessManager.h"
#include "td/telegram/BusinessWorkHours.h"
@ -3208,6 +3209,7 @@ void Td::dec_actor_refcnt() {
reset_manager(background_manager_, "BackgroundManager");
reset_manager(boost_manager_, "BoostManager");
reset_manager(bot_info_manager_, "BotInfoManager");
reset_manager(business_connection_manager_, "BusinessConnectionManager");
reset_manager(business_manager_, "BusinessManager");
reset_manager(callback_queries_manager_, "CallbackQueriesManager");
reset_manager(channel_recommendation_manager_, "ChannelRecommendationManager");
@ -3384,6 +3386,7 @@ void Td::clear() {
reset_actor(ActorOwn<Actor>(std::move(background_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(boost_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(bot_info_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(business_connection_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(business_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(channel_recommendation_manager_actor_)));
reset_actor(ActorOwn<Actor>(std::move(common_dialog_manager_actor_)));
@ -3877,6 +3880,9 @@ void Td::init_managers() {
G()->set_boost_manager(boost_manager_actor_.get());
bot_info_manager_ = make_unique<BotInfoManager>(this, create_reference());
bot_info_manager_actor_ = register_actor("BotInfoManager", bot_info_manager_.get());
business_connection_manager_ = make_unique<BusinessConnectionManager>(this, create_reference());
business_connection_manager_actor_ = register_actor("BusinessConnectionManager", business_connection_manager_.get());
G()->set_business_connection_manager(business_connection_manager_actor_.get());
business_manager_ = make_unique<BusinessManager>(this, create_reference());
business_manager_actor_ = register_actor("BusinessManager", business_manager_.get());
G()->set_business_manager(business_manager_actor_.get());

View File

@ -46,6 +46,7 @@ class AutosaveManager;
class BackgroundManager;
class BoostManager;
class BotInfoManager;
class BusinessConnectionManager;
class BusinessManager;
class CallManager;
class CallbackQueriesManager;
@ -180,6 +181,8 @@ class Td final : public Actor {
ActorOwn<BoostManager> boost_manager_actor_;
unique_ptr<BotInfoManager> bot_info_manager_;
ActorOwn<BotInfoManager> bot_info_manager_actor_;
unique_ptr<BusinessConnectionManager> business_connection_manager_;
ActorOwn<BusinessConnectionManager> business_connection_manager_actor_;
unique_ptr<BusinessManager> business_manager_;
ActorOwn<BusinessManager> business_manager_actor_;
unique_ptr<ChannelRecommendationManager> channel_recommendation_manager_;