Start auto-post on connection error when possible. Provide some feedback that we're starting to submit.
This commit is contained in:
parent
8cd6598e00
commit
c94b08c1ab
@ -1678,6 +1678,9 @@
|
|||||||
recaptcha_challenge_field: challenge,
|
recaptcha_challenge_field: challenge,
|
||||||
recaptcha_response_field: response
|
recaptcha_response_field: response
|
||||||
};
|
};
|
||||||
|
qr.status({
|
||||||
|
progress: '...'
|
||||||
|
});
|
||||||
if (engine === 'gecko' && reply.file) {
|
if (engine === 'gecko' && reply.file) {
|
||||||
file = {};
|
file = {};
|
||||||
reader = new FileReader();
|
reader = new FileReader();
|
||||||
@ -1702,18 +1705,19 @@
|
|||||||
} else if (b.childElementCount) {
|
} else if (b.childElementCount) {
|
||||||
if (b.firstChild.tagName) node = b.firstChild;
|
if (b.firstChild.tagName) node = b.firstChild;
|
||||||
err = b.firstChild.textContent;
|
err = b.firstChild.textContent;
|
||||||
if (err === 'You seem to have mistyped the verification.') {
|
}
|
||||||
|
if (err) {
|
||||||
|
if (err === 'You seem to have mistyped the verification.' || err === 'Connection error with sys.4chan.org.') {
|
||||||
qr.cooldown.auto = !!$.get('captchas', []).length;
|
qr.cooldown.auto = !!$.get('captchas', []).length;
|
||||||
qr.cooldown.set(10);
|
qr.cooldown.set(10);
|
||||||
} else {
|
} else {
|
||||||
qr.cooldown.auto = false;
|
qr.cooldown.auto = false;
|
||||||
}
|
}
|
||||||
}
|
qr.status();
|
||||||
qr.status();
|
|
||||||
if (err) {
|
|
||||||
qr.error(err, node);
|
qr.error(err, node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
qr.status();
|
||||||
reply = qr.replies[0];
|
reply = qr.replies[0];
|
||||||
persona = $.get('qr.persona', {});
|
persona = $.get('qr.persona', {});
|
||||||
persona = {
|
persona = {
|
||||||
|
|||||||
@ -1252,6 +1252,10 @@ qr =
|
|||||||
recaptcha_challenge_field: challenge
|
recaptcha_challenge_field: challenge
|
||||||
recaptcha_response_field: response
|
recaptcha_response_field: response
|
||||||
|
|
||||||
|
# Starting to upload might take some time.
|
||||||
|
# Provide some feedback that we're starting to submit.
|
||||||
|
qr.status progress: '...'
|
||||||
|
|
||||||
if engine is 'gecko' and reply.file
|
if engine is 'gecko' and reply.file
|
||||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=673742
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=673742
|
||||||
# We plan to allow postMessaging Files and FileLists across origins,
|
# We plan to allow postMessaging Files and FileLists across origins,
|
||||||
@ -1275,20 +1279,22 @@ qr =
|
|||||||
else if b.childElementCount # error!
|
else if b.childElementCount # error!
|
||||||
node = b.firstChild if b.firstChild.tagName # duplicate image link
|
node = b.firstChild if b.firstChild.tagName # duplicate image link
|
||||||
err = b.firstChild.textContent
|
err = b.firstChild.textContent
|
||||||
if err is 'You seem to have mistyped the verification.'
|
|
||||||
|
if err
|
||||||
|
if err is 'You seem to have mistyped the verification.' or err is 'Connection error with sys.4chan.org.'
|
||||||
# Enable auto-post if we have some cached captchas.
|
# Enable auto-post if we have some cached captchas.
|
||||||
qr.cooldown.auto = !!$.get('captchas', []).length
|
qr.cooldown.auto = !!$.get('captchas', []).length
|
||||||
# Too many frequent mistyped captchas will auto-ban you!
|
# Too many frequent mistyped captchas will auto-ban you!
|
||||||
|
# On connection error, the post most likely didn't go through.
|
||||||
qr.cooldown.set 10
|
qr.cooldown.set 10
|
||||||
else # stop auto-posting
|
else # stop auto-posting
|
||||||
qr.cooldown.auto = false
|
qr.cooldown.auto = false
|
||||||
|
qr.status()
|
||||||
qr.status()
|
|
||||||
|
|
||||||
if err
|
|
||||||
qr.error err, node
|
qr.error err, node
|
||||||
return
|
return
|
||||||
|
|
||||||
|
qr.status()
|
||||||
|
|
||||||
reply = qr.replies[0]
|
reply = qr.replies[0]
|
||||||
|
|
||||||
persona = $.get 'qr.persona', {}
|
persona = $.get 'qr.persona', {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user