Skip to content

fix(notifications): drop the sender's name from their own chat message - #1480

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/notification-sender-prefix
Sep 17, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/notification-sender-prefix

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

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 MessagingStyle does — it draws the Person above 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.

planMessageBody strips the prefix in applyChatStyle before style.addMessage.

Two things it is deliberate about:

  • It matches every name the sender is known by, not the one being rendered. Those disagree: the line is drawn with the address-book name when there is one, while the server composed the body from the profile's display name. Matching only the displayed name would leave the prefix in place exactly for the senders the user has saved as contacts.
  • It only strips an exact name match. A message that happens to start "Neil: " is left alone unless Neil sent it, and a body that is nothing but the prefix is kept rather than posted empty.

senderName is now the first non-blank of that same list, which is the chain it already resolved through.

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.
@bmc08gt bmc08gt self-assigned this Sep 17, 2026
@github-actions github-actions Bot added type: fix Bug fix area: notifications Push notifications, in-app messaging labels Sep 17, 2026
@bmc08gt
bmc08gt merged commit a67322c into code/cash Sep 17, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/notification-sender-prefix branch September 23, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: notifications Push notifications, in-app messaging type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant