|
|
|
@ -104,7 +104,7 @@ module.exports = function (Messaging) {
|
|
|
|
|
// Add a spacer in between messages with time gaps between them
|
|
|
|
|
messages = messages.map(function (message, index) {
|
|
|
|
|
// Compare timestamps with the previous message, and check if a spacer needs to be added
|
|
|
|
|
if (index > 0 && message.timestamp > messages[index - 1] + Messaging.newMessageCutoff) {
|
|
|
|
|
if (index > 0 && message.timestamp > messages[index - 1].timestamp + Messaging.newMessageCutoff) {
|
|
|
|
|
// If it's been 5 minutes, this is a new set of messages
|
|
|
|
|
message.newSet = true;
|
|
|
|
|
} else if (index > 0 && message.fromuid !== messages[index - 1].fromuid) {
|
|
|
|
|