diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 192647647..88509338f 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -108,23 +108,6 @@ namespace td { int VERBOSITY_NAME(get_difference) = VERBOSITY_NAME(INFO); -class OnUpdate { - UpdatesManager *updates_manager_; - tl_object_ptr &update_; - mutable Promise promise_; - - public: - OnUpdate(UpdatesManager *updates_manager, tl_object_ptr &update, Promise &&promise) - : updates_manager_(updates_manager), update_(update), promise_(std::move(promise)) { - } - - template - void operator()(T &obj) const { - CHECK(&*update_ == &obj); - updates_manager_->on_update(move_tl_object_as(update_), std::move(promise_)); - } -}; - class GetUpdatesStateQuery final : public Td::ResultHandler { Promise> promise_; diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 832753936..0ffa2eda2 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -149,7 +149,23 @@ class UpdatesManager final : public Actor { static constexpr bool DROP_PTS_UPDATES = false; static constexpr const char *AFTER_GET_DIFFERENCE_SOURCE = "after get difference"; - friend class OnUpdate; + class OnUpdate { + UpdatesManager *updates_manager_; + telegram_api::object_ptr &update_; + mutable Promise promise_; + + public: + OnUpdate(UpdatesManager *updates_manager, telegram_api::object_ptr &update, + Promise &&promise) + : updates_manager_(updates_manager), update_(update), promise_(std::move(promise)) { + } + + template + void operator()(T &obj) const { + CHECK(&*update_ == &obj); + updates_manager_->on_update(move_tl_object_as(update_), std::move(promise_)); + } + }; class PendingPtsUpdate { public: