diff --git a/td/telegram/MessageId.h b/td/telegram/MessageId.h index 1d4392e7..355b1691 100644 --- a/td/telegram/MessageId.h +++ b/td/telegram/MessageId.h @@ -150,15 +150,18 @@ class MessageId { } friend bool operator>(const MessageId &lhs, const MessageId &rhs) { - return rhs < lhs; + CHECK(lhs.is_scheduled() == rhs.is_scheduled()); + return lhs.id > rhs.id; } friend bool operator<=(const MessageId &lhs, const MessageId &rhs) { - return !(rhs < lhs); + CHECK(lhs.is_scheduled() == rhs.is_scheduled()); + return lhs.id <= rhs.id; } friend bool operator>=(const MessageId &lhs, const MessageId &rhs) { - return !(lhs < rhs); + CHECK(lhs.is_scheduled() == rhs.is_scheduled()); + return lhs.id >= rhs.id; } template