mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-22 09:12:19 -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) {
|
shouldGroupWith: function (previous) {
|
||||||
if (this.type === 'groupchat') {
|
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 {
|
} 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 {
|
} else {
|
||||||
newEl = $(model.templateHtml);
|
newEl = $(model.templateHtml);
|
||||||
this.staydown.append(newEl[0]);
|
this.staydown.append(newEl[0]);
|
||||||
|
this.lastModel = model;
|
||||||
}
|
}
|
||||||
embedIt(newEl);
|
embedIt(newEl);
|
||||||
this.lastModel = model;
|
|
||||||
},
|
},
|
||||||
handleAcceptClick: function (e) {
|
handleAcceptClick: function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -252,9 +252,9 @@ module.exports = BasePage.extend({
|
|||||||
} else {
|
} else {
|
||||||
newEl = $(model.templateHtml);
|
newEl = $(model.templateHtml);
|
||||||
this.staydown.append(newEl[0]);
|
this.staydown.append(newEl[0]);
|
||||||
|
this.lastModel = model;
|
||||||
}
|
}
|
||||||
embedIt(newEl);
|
embedIt(newEl);
|
||||||
this.lastModel = model;
|
|
||||||
},
|
},
|
||||||
refreshModel: function (model) {
|
refreshModel: function (model) {
|
||||||
var existing = this.$('#chat' + model.cid);
|
var existing = this.$('#chat' + model.cid);
|
||||||
|
Loading…
Reference in New Issue
Block a user