Skip to content
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

System messages are not hidden when showSystemMessages = false #5536

Open
Anton-Svatko opened this issue Dec 25, 2024 · 1 comment · May be fixed by #5546
Open

System messages are not hidden when showSystemMessages = false #5536

Anton-Svatko opened this issue Dec 25, 2024 · 1 comment · May be fixed by #5546
Labels
bug Something isn't working

Comments

@Anton-Svatko
Copy link

Describe the bug
The filterMessagesToShow method contains a logical error in the condition for filtering messages. Specifically, the condition:

shouldShowDeleted || (isSystemMessage && showSystemMessages)

This logic incorrectly allows all messages to be shown if shouldShowDeleted evaluates to true. Due to this bug, system messages are not hidden when showSystemMessages = false, even though they should be.

Proposed Solution
Replace the current condition:

shouldShowDeleted || (isSystemMessage && showSystemMessages)

With the corrected logic:

shouldShowDeleted && !(isSystemMessage && !showSystemMessages)

SDK version

  • 6.8.0

To Reproduce

  • Use showSystemMessages = false in MessagesViewModelFactory.
  • Send system message in chat
  • Open chat message is visible

Expected behavior

  • Message must be hidden if showSystemMessages = false

Device:

  • One plus 9r
  • Android version: 14

Screenshots
Screenshot 2024-12-25 at 10 34 49

@Anton-Svatko Anton-Svatko added the bug Something isn't working label Dec 25, 2024
@aleksandar-apostolov
Copy link
Collaborator

Hi @Anton-Svatko

Thanks for the report, we'll look into it.

Regards,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants