mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Raise directly when not checking a boolean expression
This commit is contained in:
parent
8aa358129c
commit
ea3281b5f6
1 changed files with 4 additions and 4 deletions
|
|
@ -106,21 +106,21 @@ def unpack(
|
||||||
if stored_msg_ids:
|
if stored_msg_ids:
|
||||||
# Ignored message: msg_id is lower than all of the stored values
|
# Ignored message: msg_id is lower than all of the stored values
|
||||||
if message.msg_id < stored_msg_ids[0]:
|
if message.msg_id < stored_msg_ids[0]:
|
||||||
SecurityCheckMismatch.check(False)
|
raise SecurityCheckMismatch
|
||||||
|
|
||||||
# Ignored message: msg_id is equal to any of the stored values
|
# Ignored message: msg_id is equal to any of the stored values
|
||||||
if message.msg_id in stored_msg_ids:
|
if message.msg_id in stored_msg_ids:
|
||||||
SecurityCheckMismatch.check(False)
|
raise SecurityCheckMismatch
|
||||||
|
|
||||||
time_diff = (message.msg_id - MsgId()) / 2 ** 32
|
time_diff = (message.msg_id - MsgId()) / 2 ** 32
|
||||||
|
|
||||||
# Ignored message: msg_id belongs over 30 seconds in the future
|
# Ignored message: msg_id belongs over 30 seconds in the future
|
||||||
if time_diff > 30:
|
if time_diff > 30:
|
||||||
SecurityCheckMismatch.check(False)
|
raise SecurityCheckMismatch
|
||||||
|
|
||||||
# Ignored message: msg_id belongs over 300 seconds in the past
|
# Ignored message: msg_id belongs over 300 seconds in the past
|
||||||
if time_diff < -300:
|
if time_diff < -300:
|
||||||
SecurityCheckMismatch.check(False)
|
raise SecurityCheckMismatch
|
||||||
|
|
||||||
bisect.insort(stored_msg_ids, message.msg_id)
|
bisect.insort(stored_msg_ids, message.msg_id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue