mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-22 01:02:23 -05:00
Fix: Messages group: the same day, within 5 minutes
This commit is contained in:
parent
d5886c7507
commit
9e06b50fd3
@ -238,9 +238,9 @@ var Message = module.exports = HumanModel.define({
|
||||
},
|
||||
shouldGroupWith: function (previous) {
|
||||
if (this.type === 'groupchat') {
|
||||
return previous && previous.from.full === this.from.full;
|
||||
return previous && previous.from.full === this.from.full && Math.round((this.created - previous.created) / 1000) <= 300 && previous.created.toLocaleDateString() === this.created.toLocaleDateString();
|
||||
} else {
|
||||
return previous && previous.from.bare === this.from.bare;
|
||||
return previous && previous.from.bare === this.from.bare && Math.round((this.created - previous.created) / 1000) <= 300 && previous.created.toLocaleDateString() === this.created.toLocaleDateString();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -231,9 +231,9 @@ module.exports = BasePage.extend({
|
||||
} else {
|
||||
newEl = $(model.templateHtml);
|
||||
this.staydown.append(newEl[0]);
|
||||
this.lastModel = model;
|
||||
}
|
||||
embedIt(newEl);
|
||||
this.lastModel = model;
|
||||
},
|
||||
handleAcceptClick: function (e) {
|
||||
e.preventDefault();
|
||||
|
@ -252,9 +252,9 @@ module.exports = BasePage.extend({
|
||||
} else {
|
||||
newEl = $(model.templateHtml);
|
||||
this.staydown.append(newEl[0]);
|
||||
this.lastModel = model;
|
||||
}
|
||||
embedIt(newEl);
|
||||
this.lastModel = model;
|
||||
},
|
||||
refreshModel: function (model) {
|
||||
var existing = this.$('#chat' + model.cid);
|
||||
|
Loading…
Reference in New Issue
Block a user