Implement mute chat in the core

Implement mute chat in the core, because we need it on all platforms.

It wouldn’t involve much work on the core site:

  • an extra db column in the chats table called muted until:
    • 0 not muted
    • -1 muted forever
    • >0 interpreted as unixtimestamp
  • and two functions
    • chat.isMuted() -> bool
    • chat.getMuteDuration() -> enum[notMuted, forever, until<timestamp>]

What do you think?
I would try to implement this if you agree that it is a good idea.

3 Likes

Some log from the irc discussion about this:

21:22:09          @r10s | and a 1.0 can live without this option (ios also does :)                                                                         
21:23:32          @flub | for db, one could use NULL instead of 0 for not muted. not sure what's the nicest is there                                        
21:23:34          @r10s | tbh, i thought at some point that it may makse sense to sync this state - however, meanwhile i think it is a feature to be        
                        | informed on a chat on android but not on desktop etc. - so i would not start syncing them. so, the overall use is pretty small.         
21:24:24          @r10s | on android, we just do sth. saveSystemPref("mute"+id, true) - i think this is pretty easy to implement on all systems             
21:34:20        treefit | but its not stored in the backup and desktop has 2 process which makes local prefences a little bit trickier                      
21:34:28        treefit | or less pretty
1 Like
1 Like