diff --git a/public/javascripts/chat.js b/public/javascripts/chat.js index 5d4f805..8664fc9 100644 --- a/public/javascripts/chat.js +++ b/public/javascripts/chat.js @@ -147,22 +147,18 @@ jQuery(function($) { if(offset_container.length == 0) offset_container = $('
').prependTo(history); - if (offset_container.find('.message:last').attr('data-who') == who) { - offset_container.find('.message:last .content').append('

' + body + '

'); - } - else { - if (time==undefined) { - time = new Date().toISOString(); - } - var message_html = Jabber.template('.message') - .replace('%{message}', body) - .replace(/%{who}/g, who) - .replace('%{time}', time) - .replace('%{name}', name) - .replace('%{avatar}', getAvatar(identifier)); - offset_container.append(message_html); - $(".message span.time").timeago(); + if (time==undefined) { + time = new Date().toISOString(); } + var message_html = Jabber.template('.message') + .replace('%{message}', body) + .replace(/%{who}/g, who) + .replace('%{time}', time) + .replace('%{name}', name) + .replace('%{avatar}', getAvatar(identifier)); + offset_container.append(message_html); + $(".message span.time").timeago(); + if(offset == 0) history.scrollTo({top:'100%', left:'0%'}); else history.scrollTo(offset_container.height()); if (who != "self") { -- libgit2 0.21.2