diff --git a/converse.js b/converse.js index a9dea9b92..7c529020d 100644 --- a/converse.js +++ b/converse.js @@ -1370,9 +1370,13 @@ return this; }, + clearStatusNotification: function () { + this.$content.find('div.chat-event').remove(); + }, + showStatusNotification: function (message, keep_old) { if (!keep_old) { - this.$content.find('div.chat-event').remove(); + this.clearStatusNotification(); } this.$content.append($('
').text(message)); this.scrollDown(); @@ -1575,9 +1579,14 @@ * Parameters: * (Object) message - The message Backbone object that was added. */ + if (typeof this.clear_status_timeout !== 'undefined') { + clearTimeout(this.clear_status_timeout); + delete this.clear_status_timeout; + } if (!message.get('message')) { if (message.get('chat_state') === COMPOSING) { this.showStatusNotification(message.get('fullname')+' '+__('is typing')); + this.clear_status_timeout = setTimeout(this.clearStatusNotification.bind(this), 10000); return; } else if (message.get('chat_state') === PAUSED) { this.showStatusNotification(message.get('fullname')+' '+__('has stopped typing')); diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 4c1def6c9..a204c16a9 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -7,6 +7,7 @@ Changelog * #493 Refactor previous bugfix and now an event is emitted when a roster push event from server happens. [teseo] * #502. Chat room not opened in non_amd version. [rjanbiah] * #505 Typo caused [object Object] in room info [gromiak] +* #508 "Is typing" doesn't automatically disappear [jcbrand] * #510 MUC room memberlist is being cleared with page reload when keepalive option is set. [jcbrand] * Add the ability to also drag-resize chat boxes horizontally. [jcbrand]