-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Group messages from the same user #552
Conversation
if (a.senderAlias == b.senderAlias && a.sender?.id == b.sender?.id && !a.isSystemMessage() && !b.isSystemMessage()) { | ||
val date1 = a.getDate() | ||
val date2 = b.getDate() | ||
return date1.isSameDay(date2) && date1.timeInMillis - date2.timeInMillis < messageGroupingPeriod * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its an edge case but, if I send a message at 11:59 PM and then another at 12:01 AM on the next day, I would expect these to group together, but this would not occur given the above logic. Is there a reason for the isSameDay check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes It will not group message with different days. In the upstream issue it is mentioned that "When there's a day separator, can't be sequential", so logic is based on that.
If you want to group message even if different day then we can remove "isSameDay" condition. But that will not look good because there will be day separator.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I think as a user I would actually expect/want to see the separator upon the day change, so I don't see the need for getting grouping to work in that case
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageViewHolder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/chat/rocket/android/chatroom/ui/MessageFlexLayout.kt
Outdated
Show resolved
Hide resolved
405c689
to
046361e
Compare
Closes #535
Upstream issue: RocketChat#712
Changes:
Widechat's Message_GroupingPeriod is 300 seconds