diff --git a/4chan_x.user.js b/4chan_x.user.js index 58ddcd905..4f5eb8d5e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2512,9 +2512,10 @@ }, cooldown: { start: function(e) { - var fullID, seconds; - seconds = g.BOARD.ID === 'q' ? 600 : 30; - fullID = "" + g.BOARD + "." + e.detail.postID; + var board, fullID, postID, seconds, _ref; + _ref = e.detail, board = _ref.board, postID = _ref.postID; + seconds = board.ID === 'q' ? 600 : 30; + fullID = "" + board + "." + postID; return DeleteLink.cooldown.count(fullID, seconds, seconds); }, count: function(fullID, seconds, length) { @@ -6339,6 +6340,8 @@ } else if (g.BOARD.ID === 'f' && filetag === '9999') { err = 'Invalid tag specified.'; } + } else if (g.BOARD.threads[threadID].isSticky) { + err = 'You can\'t reply to this thread anymore.'; } else if (!(reply.com || reply.file)) { err = 'No file selected.'; } diff --git a/src/features.coffee b/src/features.coffee index dea879758..59866affc 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1341,12 +1341,13 @@ DeleteLink = cooldown: start: (e) -> + {board, postID} = e.detail seconds = - if g.BOARD.ID is 'q' + if board.ID is 'q' 600 else 30 - fullID = "#{g.BOARD}.#{e.detail.postID}" + fullID = "#{board}.#{postID}" DeleteLink.cooldown.count fullID, seconds, seconds count: (fullID, seconds, length) -> return unless 0 <= seconds <= length diff --git a/src/qr.coffee b/src/qr.coffee index 6a92e0f8d..cfa4d6401 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -647,8 +647,10 @@ QR = err = 'No file selected.' else if g.BOARD.ID is 'f' and filetag is '9999' err = 'Invalid tag specified.' + else if g.BOARD.threads[threadID].isSticky + err = 'You can\'t reply to this thread anymore.' else unless reply.com or reply.file - err = 'No file selected.' + err = 'No file selected.' if QR.captcha.isEnabled and !err # get oldest valid captcha