Fix cooldown when the time is an exact number of minutes. #2301
This commit is contained in:
parent
9eed6ee89e
commit
c6d4a42467
@ -798,9 +798,11 @@ QR =
|
|||||||
# On connection error, the post most likely didn't go through.
|
# On connection error, the post most likely didn't go through.
|
||||||
# If the post did go through, it should be stopped by the duplicate reply cooldown.
|
# If the post did go through, it should be stopped by the duplicate reply cooldown.
|
||||||
QR.cooldown.addDelay post, 2
|
QR.cooldown.addDelay post, 2
|
||||||
else if err.textContent and (m = err.textContent.match /(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i) and !/duplicate|hour/i.test(err.textContent)
|
else if err.textContent and (m = err.textContent.match /\d+\s+(?:minute|second)/gi) and !/duplicate|hour/i.test(err.textContent)
|
||||||
QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent)
|
QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent)
|
||||||
seconds = 60 * (+(m[1]||0)) + (+m[2])
|
seconds = 0
|
||||||
|
for mi in m
|
||||||
|
seconds += (if /minute/i.test(mi) then 60 else 1) * (+mi.match(/\d+/)[0])
|
||||||
if /muted/i.test err.textContent
|
if /muted/i.test err.textContent
|
||||||
QR.cooldown.addMute seconds
|
QR.cooldown.addMute seconds
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user