fix date line being off by 1 message - #552
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #536
consider the following three messages:
the previous code iterated messages in reverse order (i.e. C, then B, then A). Upon encountering message B,
previous_msg_dayis day 2, from message C - sodisplay_date_linewould trigger and returnSome("=== day 2 ===")(the day of theprevious_msg_day).display_messagewould then put=== day 2 ===at the TOP of message B (not the bottom!). This caused message B to be in the "wrong day".There's two ways to fix this: put
=== day 2 ===at the bottom of message B, or, detect that we need a date line while processing message C (not B), and continue putting the date line at the top of the message. This PR does the latter. This also has the (intended) side effect of the first message ever sent in a channel now has a date line, it previously did not.thanks for making/working on gurk, it's so hecking nice to be able to use signal on a desktop without using electron! ❤️