Commit b7933449 authored by JC Brand's avatar JC Brand

Merge pull request #359 from floriancargoet/fix/chat_state_timeout

Fix a timeout bug in chat state notifications
parents 5ec7c67b a9a4935e
...@@ -1243,12 +1243,11 @@ ...@@ -1243,12 +1243,11 @@
* (string) state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE) * (string) state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE)
* (no_save) no_save - Just do the cleanup or setup but don't actually save the state. * (no_save) no_save - Just do the cleanup or setup but don't actually save the state.
*/ */
if (_.contains([ACTIVE, INACTIVE, GONE], state)) { if (typeof this.chat_state_timeout !== 'undefined') {
if (typeof this.chat_state_timeout !== 'undefined') { clearTimeout(this.chat_state_timeout);
clearTimeout(this.chat_state_timeout); delete this.chat_state_timeout;
delete this.chat_state_timeout; }
} if (state === COMPOSING) {
} else if (state === COMPOSING) {
this.chat_state_timeout = setTimeout( this.chat_state_timeout = setTimeout(
$.proxy(this.setChatState, this), converse.TIMEOUTS.PAUSED, PAUSED); $.proxy(this.setChatState, this), converse.TIMEOUTS.PAUSED, PAUSED);
} else if (state === PAUSED) { } else if (state === PAUSED) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment