Move class OnUpdate inside UpdatesManager.
This commit is contained in:
parent
52f24d72f5
commit
9858220708
@ -108,23 +108,6 @@ namespace td {
|
|||||||
|
|
||||||
int VERBOSITY_NAME(get_difference) = VERBOSITY_NAME(INFO);
|
int VERBOSITY_NAME(get_difference) = VERBOSITY_NAME(INFO);
|
||||||
|
|
||||||
class OnUpdate {
|
|
||||||
UpdatesManager *updates_manager_;
|
|
||||||
tl_object_ptr<telegram_api::Update> &update_;
|
|
||||||
mutable Promise<Unit> promise_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
OnUpdate(UpdatesManager *updates_manager, tl_object_ptr<telegram_api::Update> &update, Promise<Unit> &&promise)
|
|
||||||
: updates_manager_(updates_manager), update_(update), promise_(std::move(promise)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void operator()(T &obj) const {
|
|
||||||
CHECK(&*update_ == &obj);
|
|
||||||
updates_manager_->on_update(move_tl_object_as<T>(update_), std::move(promise_));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class GetUpdatesStateQuery final : public Td::ResultHandler {
|
class GetUpdatesStateQuery final : public Td::ResultHandler {
|
||||||
Promise<tl_object_ptr<telegram_api::updates_state>> promise_;
|
Promise<tl_object_ptr<telegram_api::updates_state>> promise_;
|
||||||
|
|
||||||
|
@ -149,7 +149,23 @@ class UpdatesManager final : public Actor {
|
|||||||
static constexpr bool DROP_PTS_UPDATES = false;
|
static constexpr bool DROP_PTS_UPDATES = false;
|
||||||
static constexpr const char *AFTER_GET_DIFFERENCE_SOURCE = "after get difference";
|
static constexpr const char *AFTER_GET_DIFFERENCE_SOURCE = "after get difference";
|
||||||
|
|
||||||
friend class OnUpdate;
|
class OnUpdate {
|
||||||
|
UpdatesManager *updates_manager_;
|
||||||
|
telegram_api::object_ptr<telegram_api::Update> &update_;
|
||||||
|
mutable Promise<Unit> promise_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
OnUpdate(UpdatesManager *updates_manager, telegram_api::object_ptr<telegram_api::Update> &update,
|
||||||
|
Promise<Unit> &&promise)
|
||||||
|
: updates_manager_(updates_manager), update_(update), promise_(std::move(promise)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void operator()(T &obj) const {
|
||||||
|
CHECK(&*update_ == &obj);
|
||||||
|
updates_manager_->on_update(move_tl_object_as<T>(update_), std::move(promise_));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class PendingPtsUpdate {
|
class PendingPtsUpdate {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user