diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4cc888e..3fa7e0637 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor ### v1.11.13 +**v1.11.13.9** *(2015-10-24)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.9/builds/4chan-X-noupdate.crx "Chromium version")] +- Include /r9k/ mute time in cooldowns. + **v1.11.13.8** *(2015-10-23)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.8/builds/4chan-X-noupdate.crx "Chromium version")] - Bugfix: Fix case where LaTeX preview could not be turned off. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index ae6d82e62..8ffded605 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index ee5716228..8118125f4 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.11.13.8 +// @version 1.11.13.9 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index ff8b2b992..3d2d0311f 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.11.13.8 +// @version 1.11.13.9 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.8', + VERSION: '1.11.13.9', NAMESPACE: '4chan X.', boards: {} }; @@ -7709,7 +7709,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7741,9 +7741,14 @@ } QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false; QR.cooldown.addDelay(post, 2); - } else if (err.textContent && (m = err.textContent.match(/wait\s+(\d+)\s+second/i)) && !/duplicate/i.test(err.textContent)) { - QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : true; - QR.cooldown.addDelay(post, +m[1]); + } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) { + QR.cooldown.auto = (!QR.captcha.isEnabled || !!QR.captcha.captchas.length) && !/have\s+been\s+muted/i.test(err.textContent); + seconds = 60 * (+(m[1] || 0)) + (+m[2]); + if (/muted/i.test(err.textContent)) { + QR.cooldown.addMute(seconds); + } else { + QR.cooldown.addDelay(post, seconds); + } QR.captcha.setup(d.activeElement === QR.nodes.status); } else { QR.cooldown.auto = false; @@ -8769,6 +8774,16 @@ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); return QR.cooldown.start(); }, + addMute: function(delay) { + if (!Conf['Cooldown']) { + return; + } + QR.cooldown.set(g.BOARD.ID, Date.now(), { + type: 'mute', + delay: delay + }); + return QR.cooldown.start(); + }, "delete": function(post) { var base1, cooldown, cooldowns, id, name1; if (!Conf['Cooldown']) { @@ -8854,7 +8869,7 @@ if (cooldown.delay <= elapsed) { delete cooldowns[start]; save.push(scope); - } else if (cooldown.type === type && cooldown.threadID === threadID) { + } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { seconds = Math.max(seconds, cooldown.delay - elapsed); } continue; diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index b29f597b3..59322bd60 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index 7e0886f1c..25b1b4c02 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.11.13.8 +// @version 1.11.13.9 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.8', + VERSION: '1.11.13.9', NAMESPACE: '4chan X.', boards: {} }; @@ -7709,7 +7709,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7741,9 +7741,14 @@ } QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false; QR.cooldown.addDelay(post, 2); - } else if (err.textContent && (m = err.textContent.match(/wait\s+(\d+)\s+second/i)) && !/duplicate/i.test(err.textContent)) { - QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : true; - QR.cooldown.addDelay(post, +m[1]); + } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) { + QR.cooldown.auto = (!QR.captcha.isEnabled || !!QR.captcha.captchas.length) && !/have\s+been\s+muted/i.test(err.textContent); + seconds = 60 * (+(m[1] || 0)) + (+m[2]); + if (/muted/i.test(err.textContent)) { + QR.cooldown.addMute(seconds); + } else { + QR.cooldown.addDelay(post, seconds); + } QR.captcha.setup(d.activeElement === QR.nodes.status); } else { QR.cooldown.auto = false; @@ -8769,6 +8774,16 @@ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); return QR.cooldown.start(); }, + addMute: function(delay) { + if (!Conf['Cooldown']) { + return; + } + QR.cooldown.set(g.BOARD.ID, Date.now(), { + type: 'mute', + delay: delay + }); + return QR.cooldown.start(); + }, "delete": function(post) { var base1, cooldown, cooldowns, id, name1; if (!Conf['Cooldown']) { @@ -8854,7 +8869,7 @@ if (cooldown.delay <= elapsed) { delete cooldowns[start]; save.push(scope); - } else if (cooldown.type === type && cooldown.threadID === threadID) { + } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { seconds = Math.max(seconds, cooldown.delay - elapsed); } continue; diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index b7ba64f89..27c139404 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 7dd7d87d1..221b88147 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.13.8 +// @version 1.11.13.9 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 68bbbeb3c..656032626 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.11.13.8 +// @version 1.11.13.9 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.8', + VERSION: '1.11.13.9', NAMESPACE: '4chan X.', boards: {} }; @@ -7709,7 +7709,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7741,9 +7741,14 @@ } QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false; QR.cooldown.addDelay(post, 2); - } else if (err.textContent && (m = err.textContent.match(/wait\s+(\d+)\s+second/i)) && !/duplicate/i.test(err.textContent)) { - QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : true; - QR.cooldown.addDelay(post, +m[1]); + } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) { + QR.cooldown.auto = (!QR.captcha.isEnabled || !!QR.captcha.captchas.length) && !/have\s+been\s+muted/i.test(err.textContent); + seconds = 60 * (+(m[1] || 0)) + (+m[2]); + if (/muted/i.test(err.textContent)) { + QR.cooldown.addMute(seconds); + } else { + QR.cooldown.addDelay(post, seconds); + } QR.captcha.setup(d.activeElement === QR.nodes.status); } else { QR.cooldown.auto = false; @@ -8769,6 +8774,16 @@ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); return QR.cooldown.start(); }, + addMute: function(delay) { + if (!Conf['Cooldown']) { + return; + } + QR.cooldown.set(g.BOARD.ID, Date.now(), { + type: 'mute', + delay: delay + }); + return QR.cooldown.start(); + }, "delete": function(post) { var base1, cooldown, cooldowns, id, name1; if (!Conf['Cooldown']) { @@ -8854,7 +8869,7 @@ if (cooldown.delay <= elapsed) { delete cooldowns[start]; save.push(scope); - } else if (cooldown.type === type && cooldown.threadID === threadID) { + } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { seconds = Math.max(seconds, cooldown.delay - elapsed); } continue; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 88c589762..f323c764a 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index f6cfaa83d..d24c13610 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index e4e09467c..7485c3287 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 676d99db5..324f99d2c 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "meta": { "name": "4chan X", "fork": "ccd0", - "version": "1.11.13.8", - "date": "2015-10-24T02:39:06.584Z", + "version": "1.11.13.9", + "date": "2015-10-25T00:38:31.311Z", "page": "https://www.4chan-x.net/", "downloads": "https://www.4chan-x.net/builds/", "oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/", diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 5617bab74..1351eefc3 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -773,12 +773,13 @@ QR = # Too many frequent mistyped captchas will auto-ban you! # On connection error, the post most likely didn't go through. QR.cooldown.addDelay post, 2 - else if err.textContent and (m = err.textContent.match /wait\s+(\d+)\s+second/i) and !/duplicate/i.test err.textContent - QR.cooldown.auto = if QR.captcha.isEnabled - !!QR.captcha.captchas.length + else if err.textContent and (m = err.textContent.match /(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i) and !/duplicate|hour/i.test(err.textContent) + QR.cooldown.auto = (!QR.captcha.isEnabled or !!QR.captcha.captchas.length) and !/have\s+been\s+muted/i.test(err.textContent) + seconds = 60 * (+(m[1]||0)) + (+m[2]) + if /muted/i.test err.textContent + QR.cooldown.addMute seconds else - true - QR.cooldown.addDelay post, +m[1] + QR.cooldown.addDelay post, seconds QR.captcha.setup (d.activeElement is QR.nodes.status) else # stop auto-posting QR.cooldown.auto = false diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index 8fae874d3..2868bf840 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -60,6 +60,11 @@ QR.cooldown = QR.cooldown.set g.BOARD.ID, Date.now(), cooldown QR.cooldown.start() + addMute: (delay) -> + return unless Conf['Cooldown'] + QR.cooldown.set g.BOARD.ID, Date.now(), {type: 'mute', delay} + QR.cooldown.start() + delete: (post) -> return unless Conf['Cooldown'] $.forceSync 'cooldowns' @@ -121,7 +126,7 @@ QR.cooldown = if cooldown.delay <= elapsed delete cooldowns[start] save.push scope - else if cooldown.type is type and cooldown.threadID is threadID + else if (cooldown.type is type and cooldown.threadID is threadID) or cooldown.type is 'mute' # Delays only apply to the given post type and thread. seconds = Math.max seconds, cooldown.delay - elapsed continue