Connection errors and aborted posts should requeue the captcha. #1192
This commit is contained in:
parent
e4a00d3b0c
commit
9956fadfbe
@ -661,6 +661,8 @@ 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.
|
||||||
delete QR.req
|
delete QR.req
|
||||||
|
Captcha.cache.save QR.currentCaptcha if QR.currentCaptcha
|
||||||
|
delete QR.currentCaptcha
|
||||||
post.unlock()
|
post.unlock()
|
||||||
QR.cooldown.auto = true
|
QR.cooldown.auto = true
|
||||||
QR.cooldown.addDelay post, 2
|
QR.cooldown.addDelay post, 2
|
||||||
@ -681,6 +683,7 @@ QR =
|
|||||||
QR.status()
|
QR.status()
|
||||||
|
|
||||||
if captcha?
|
if captcha?
|
||||||
|
QR.currentCaptcha = captcha
|
||||||
if captcha.challenge?
|
if captcha.challenge?
|
||||||
extra.form.append 'recaptcha_challenge_field', captcha.challenge
|
extra.form.append 'recaptcha_challenge_field', captcha.challenge
|
||||||
extra.form.append 'recaptcha_response_field', captcha.response
|
extra.form.append 'recaptcha_response_field', captcha.response
|
||||||
@ -705,9 +708,12 @@ QR =
|
|||||||
$('a', err)?.target = '_blank' # duplicate image link
|
$('a', err)?.target = '_blank' # duplicate image link
|
||||||
else if (connErr = resDoc.title isnt 'Post successful!')
|
else if (connErr = resDoc.title isnt 'Post successful!')
|
||||||
err = QR.connectionError()
|
err = QR.connectionError()
|
||||||
|
Captcha.cache.save QR.currentCaptcha if QR.currentCaptcha
|
||||||
else if req.status isnt 200
|
else if req.status isnt 200
|
||||||
err = "Error #{req.statusText} (#{req.status})"
|
err = "Error #{req.statusText} (#{req.status})"
|
||||||
|
|
||||||
|
delete QR.currentCaptcha
|
||||||
|
|
||||||
if err
|
if err
|
||||||
if /captcha|verification/i.test(err.textContent) or connErr
|
if /captcha|verification/i.test(err.textContent) or connErr
|
||||||
# Remove the obnoxious 4chan Pass ad.
|
# Remove the obnoxious 4chan Pass ad.
|
||||||
@ -809,6 +815,8 @@ QR =
|
|||||||
if QR.req and !QR.req.isUploadFinished
|
if QR.req and !QR.req.isUploadFinished
|
||||||
QR.req.abort()
|
QR.req.abort()
|
||||||
delete QR.req
|
delete QR.req
|
||||||
|
Captcha.cache.save QR.currentCaptcha if QR.currentCaptcha
|
||||||
|
delete QR.currentCaptcha
|
||||||
QR.posts[0].unlock()
|
QR.posts[0].unlock()
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.notifications.push new Notice 'info', 'QR upload aborted.', 5
|
QR.notifications.push new Notice 'info', 'QR upload aborted.', 5
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user