revoltchat / rvmob

React Native Revolt client. Community-led project.
https://rvlt.gg/rvmob
GNU Affero General Public License v3.0
115 stars 17 forks source link

feat: better notification logic + websocket updates #23

Closed account0123 closed 11 months ago

account0123 commented 11 months ago

This notification feature follows the logic:

  1. Is muted? True if channel/server has "muted" or "none" config
  2. Channel has "all" config? If not, [1]? If not [1], server has "all" config?
  3. Does message include mentions (with/without autoping)? If not, is message from DM?
  4. Notification shows if [2] AND (autoping OR different author), OR not [1] AND [3]

Notification also formats embeds as '[Embed]' and attachments as 'Image', 'Video', 'Audio' or 'File' Author username is bold

I included websocket listeners to live update the MainView state. ~Sorry for messy code again.~ Prettier did things.

Please make sure to check the following tasks before opening and submitting a PR