Skip to content

Conversation

whflima
Copy link
Contributor

@whflima whflima commented Jul 30, 2025

Closes #200

Description

Previously, the sender was identified by comparing message.sender (a nickname string) to currentUserNickname. This caused issues when the nickname changed, since past messages would then match or not match incorrectly, leading to inconsistent color assignments.

The updated logic compares message.senderPeerID to meshService.myPeerID, which is a unique and stable identifier for the user. This ensures that the correct color (colorScheme.primary) is applied consistently to the user's own messages, regardless of any nickname changes.

Why this matters

  • Fixes a bug where changing your nickname would retroactively change the color of your past messages.

  • Prevents conflicts where multiple users with the same nickname might get the same sender color.

  • Makes message ownership checks more reliable by using a unique ID instead of a mutable nickname.

Screenshots/Screen recordings

pr-video.mp4

Checklist

@callebtc
Copy link
Collaborator

nice catch, thank you

@callebtc callebtc merged commit c92d2d2 into permissionlesstech:main Jul 31, 2025
1 check passed
iAmEben pushed a commit to iAmEben/bitchat-android that referenced this pull request Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When you change your nickname, the sender color of your past messages also changes.
2 participants