Skip to content

Commit

Permalink
Closes #1691; Fiz a grouping error in messages from history
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Dec 17, 2015
1 parent 513034b commit 4279690
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/rocketchat-ui-message/message/message.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,29 @@ Template.message.onViewRendered = (context) ->

if previousDataset.date isnt currentDataset.date
$currentNode.addClass('new-day').removeClass('sequential')
else
$currentNode.removeClass('new-day')

if previousDataset.groupable is 'false' or previousDataset.username isnt currentDataset.username or parseInt(currentDataset.timestamp) - parseInt(previousDataset.timestamp) > RocketChat.settings.get('Message_GroupingPeriod') * 1000
if previousDataset.groupable is 'false'
$currentNode.removeClass('sequential')
else
if previousDataset.username isnt currentDataset.username or parseInt(currentDataset.timestamp) - parseInt(previousDataset.timestamp) > RocketChat.settings.get('Message_GroupingPeriod') * 1000
$currentNode.removeClass('sequential')
else
$currentNode.addClass('sequential')

if nextNode?.dataset?
nextDataset = nextNode.dataset

if nextDataset.date isnt currentDataset.date
$nextNode.addClass('new-day').removeClass('sequential')
else
$nextNode.removeClass('new-day')

if nextDataset.username isnt currentDataset.username or parseInt(nextDataset.timestamp) - parseInt(currentDataset.timestamp) > RocketChat.settings.get('Message_GroupingPeriod') * 1000
$nextNode.removeClass('sequential')
else
$nextNode.addClass('sequential')

if not nextNode?
templateInstance = view.parentView.parentView.parentView.parentView.parentView.templateInstance?()
Expand Down

0 comments on commit 4279690

Please sign in to comment.