zulip-flutter
zulip-flutter copied to clipboard
content: Highlight non-silent mentions of the self-user
This probably makes sense to do after #646.
We should highlight non-silent mentions of the self-user, following web, so that users can easily see when a mention is intended to get their attention.
For some examples (and here I'm logged in as the "Chris Bobbe" account):
Notice the highlighting is done in two ways:
- The text of the mention itself is styled
- The whole message gets an interesting background color
Implementation
To determine if the self-user is mentioned, we'll use the corresponding per-user flags on the message. Any of the "mentioned" flags here (some of which are to be added by #894): https://zulip.com/api/update-message-flags#available-flags mean that the self-user was mentioned.
That's enough to know we should highlight the message. Then to highlight the mention within the message, if one or more of those flags is set we'll search the message content to find the corresponding mentions.