always scroll down when user sends a message

This commit is contained in:
JC Brand 2016-05-27 12:42:31 +00:00
parent 62f0aacf56
commit 032fe0d417

View File

@ -329,8 +329,16 @@
handleTextMessage: function (message) { handleTextMessage: function (message) {
this.showMessage(_.clone(message.attributes)); this.showMessage(_.clone(message.attributes));
if ((message.get('sender') !== 'me') && (converse.windowState === 'blur') || this.model.get('scrolled', true)) { if (message.get('sender') !== 'me') {
converse.incrementMsgCounter(); if (converse.windowState === 'blur' || this.model.get('scrolled', true)) {
converse.incrementMsgCounter();
}
} else {
// We remove the "scrolled" flag so that the chat area
// gets scrolled down. We always want to scroll down
// when the user writes a message as opposed to when a
// message is received.
this.model.set('scrolled', false);
} }
if (this.shouldShowOnTextMessage()) { if (this.shouldShowOnTextMessage()) {
this.show(); this.show();