Repository navigation
fix(notifications): drop the sender's name from their own chat message - #1480
Merged
Merged
Conversation
A chat notification reads "Kevin Ricoy: whoa" under a line that already says Kevin Ricoy. The server composes the body that way because a plain notification has nowhere else to put the sender, but MessagingStyle does: it draws the Person above the message in a group, and in a DM the notification's own title carries the name. planMessageBody strips the prefix before the message is added. It matches against every name the sender is known by rather than the one being rendered — the line uses the address-book name when there is one, while the body was composed from the profile's display name — and only on an exact match, so a message that happens to start "Neil: " survives unless Neil sent it.
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.
A chat notification reads "Some Person: whoa" directly under a line that already says Some Person. The server composes the body that way because a plain notification has nowhere else to put the sender, but
MessagingStyledoes — it draws thePersonabove the message in a group, and in a DM the notification's own title carries the name. So the name lands twice wherever a sender is attached.planMessageBodystrips the prefix inapplyChatStylebeforestyle.addMessage.Two things it is deliberate about:
senderNameis now the first non-blank of that same list, which is the chain it already resolved through.