Posting an image after a reply has no cooldown.

This commit is contained in:
Mayhem 2013-09-20 10:53:42 +02:00
parent 124a2ef473
commit 47347d95f5
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,6 @@
Tiny posting cooldown adjustment:
- You can post an image reply immediately after a non-image reply.
### 3.11.3 - *2013-09-19*
Update posting cooldown timers to match 4chan settings:

View File

@ -259,11 +259,11 @@ QR =
if delay
cooldown = {delay}
else
if post.file
if hasFile = !!post.file
upSpd = post.file.size / ((start - req.uploadStartTime) / $.SECOND)
QR.cooldown.upSpdAccuracy = ((upSpd > QR.cooldown.upSpd * .9) + QR.cooldown.upSpdAccuracy) / 2
QR.cooldown.upSpd = upSpd
cooldown = {isReply, threadID}
cooldown = {isReply, hasFile, threadID}
QR.cooldown.cooldowns[start] = cooldown
$.set "cooldown.#{g.BOARD}", QR.cooldown.cooldowns
QR.cooldown.start()
@ -310,12 +310,16 @@ QR =
# reply cooldown with a reply, thread cooldown with a thread
elapsed = Math.floor (now - start) / $.SECOND
continue if elapsed < 0 # clock changed since then?
type = unless isReply
'thread'
unless isReply
type = 'thread'
else if hasFile
'image'
# You can post an image reply immediately after a non-image reply.
unless cooldown.hasFile
seconds = Math.max seconds, 0
continue
type = 'image'
else
'reply'
type = 'reply'
maxTimer = Math.max types[type] or 0, types[type + '_intra'] or 0
unless start <= now <= start + maxTimer * $.SECOND
QR.cooldown.unset start