Fix MessageId::is_valid_scheduled.

This commit is contained in:
levlam 2021-08-25 11:29:57 +03:00
parent 8559392f6f
commit fcfbb38f63
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ bool MessageId::is_valid() const {
}
bool MessageId::is_valid_scheduled() const {
if (id <= 0 || id > max().get()) {
if (id <= 0 || id > (static_cast<int64>(1) << 51)) {
return false;
}
int32 type = (id & TYPE_MASK);
@ -43,7 +43,7 @@ bool MessageId::is_valid_scheduled() const {
}
MessageType MessageId::get_type() const {
if (id <= 0 || id > max().get()) {
if (id <= 0 || id > (static_cast<int64>(1) << 51)) {
return MessageType::None;
}

View File

@ -15273,7 +15273,7 @@ unique_ptr<MessagesManager::Message> MessagesManager::do_delete_scheduled_messag
bool is_permanently_deleted,
const char *source) {
CHECK(d != nullptr);
CHECK(message_id.is_valid_scheduled());
LOG_CHECK(message_id.is_valid_scheduled()) << d->dialog_id << ' ' << message_id << ' ' << source;
unique_ptr<Message> *v = treap_find_message(&d->scheduled_messages, message_id);
if (*v == nullptr) {