Add BusinessConnectionManager::check_business_connection_id.

This commit is contained in:
levlam 2024-03-07 20:03:12 +03:00
parent 4bc3b380b8
commit 0a703fb8c2
2 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,13 @@ void BusinessConnectionManager::tear_down() {
parent_.reset();
}
Status BusinessConnectionManager::check_business_connection_id(const string &connection_id) const {
if (connection_id.empty() || business_connections_.count(connection_id) != 0) {
return Status::OK();
}
return Status::Error(400, "Business connection not found");
}
void BusinessConnectionManager::on_update_bot_business_connect(
telegram_api::object_ptr<telegram_api::botBusinessConnection> &&connection) {
CHECK(connection != nullptr);

View File

@ -29,6 +29,8 @@ class BusinessConnectionManager final : public Actor {
BusinessConnectionManager &operator=(BusinessConnectionManager &&) = delete;
~BusinessConnectionManager() final;
Status check_business_connection_id(const string &connection_id) const;
void on_update_bot_business_connect(telegram_api::object_ptr<telegram_api::botBusinessConnection> &&connection);
void get_business_connection(const string &connection_id,