Only emit a single message per channel on init

This commit is contained in:
Pavel Djundik 2017-10-29 19:41:19 +02:00
parent 2f47307437
commit 41e121d270
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@
<span title="{{topic}}" class="topic">{{{parse topic}}}</span>
</div>
<div class="chat">
<div class="show-more {{#equal messages.length 100}}show{{/equal}}">
<div class="show-more{{#if messages.length}} show{{/if}}">
<button class="show-more-button" data-id="{{id}}">Show older messages</button>
</div>
<div class="messages"></div>

View file

@ -139,7 +139,7 @@ Chan.prototype.removeUser = function(user) {
Chan.prototype.toJSON = function() {
var clone = _.clone(this);
clone.users = []; // Do not send user list, the client will explicitly request it when needed
clone.messages = clone.messages.slice(-100);
clone.messages = clone.messages.slice(-1);
return clone;
};