diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 985c0a144..7741f902e 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -532,7 +532,7 @@ class RequestActor : public Actor { void raw_event(const Event::Raw &event) override { if (future_.is_error()) { auto error = future_.move_as_error(); - if (error == Status::Hangup()) { + if (error == Status::Error::Hangup>()) { // dropping query due to lost authorization or lost promise // td may be already closed, so we should check is auth_manager_ is empty bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized(); diff --git a/tdactor/td/actor/PromiseFuture.h b/tdactor/td/actor/PromiseFuture.h index 026bceda7..a83d230d1 100644 --- a/tdactor/td/actor/PromiseFuture.h +++ b/tdactor/td/actor/PromiseFuture.h @@ -461,6 +461,8 @@ class FutureActor final : public Actor { enum State { Waiting, Ready }; public: + static constexpr int Hangup = 426487; + FutureActor() = default; FutureActor(const FutureActor &other) = delete; @@ -534,7 +536,7 @@ class FutureActor final : public Actor { } void hangup() override { - set_error(Status::Hangup()); + set_error(Status::Error()); } void start_up() override { diff --git a/tdutils/td/utils/Status.h b/tdutils/td/utils/Status.h index 593b11906..43f81229f 100644 --- a/tdutils/td/utils/Status.h +++ b/tdutils/td/utils/Status.h @@ -85,10 +85,7 @@ class Status { Status() = default; bool operator==(const Status &other) const { - if (get_info().static_flag) { - return ptr_ == other.ptr_; - } - return false; + return ptr_ == other.ptr_; } Status clone() const TD_WARN_UNUSED_RESULT { @@ -136,16 +133,6 @@ class Status { return status.clone_static(); } - static Status InvalidId() TD_WARN_UNUSED_RESULT { - static Status status(true, ErrorType::general, 0, "Invalid Id"); - return status.clone_static(); - } - - static Status Hangup() TD_WARN_UNUSED_RESULT { - static Status status(true, ErrorType::general, 0, "Hangup"); - return status.clone_static(); - } - StringBuilder &print(StringBuilder &sb) const { if (is_ok()) { return sb << "OK";