Fix MessageId::is_valid_scheduled.
This commit is contained in:
parent
8559392f6f
commit
fcfbb38f63
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user