Skip to content

Commit

Permalink
Merge pull request #1852 from Morfent/chatqueue
Browse files Browse the repository at this point in the history
Use last message time for timeout on chat queue creation
  • Loading branch information
Zarel committed May 3, 2015
2 parents 5a97029 + 4289cc8 commit 7550c80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion users.js
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,8 @@ User = (function () {
} else if (now < this.lastChatMessage + THROTTLE_DELAY) {
this.chatQueue = [[message, room, connection]];
this.chatQueueTimeout = setTimeout(
this.processChatQueue.bind(this), THROTTLE_DELAY);
this.processChatQueue.bind(this),
THROTTLE_DELAY - (now - this.lastChatMessage));
} else {
this.lastChatMessage = now;
ResourceMonitor.activeIp = connection.ip;
Expand Down

0 comments on commit 7550c80

Please sign in to comment.