# Back-end todo
- Nieuwe features (Back-end, Henri):
- Status van de users : offline, online, aanwezig in chatroom, typing
- Hashing langs client
- i am not a robot?
- Aantal ongelezen berichten?
- Aantal users in een kanaal?
- Gebruikers uitnodigen ipv toevoegen aan private room?
- Informatie over vrienden, groepen en users in limbo automatisch opsturen bij inloggen?
- Server efficienter maken? vb. lijsten van profielen ipv lijsten van ids
- Potentiële bug : delete profile in een room
- Extra messages opvragen indien nodig
- Encrypten server
- Ping & Pong
- bugs :
- delete profile in een room?
- trage load en lag
- don't send requests if connected / when server connects : clear all requests
- Geen meerdere friend requests?
- Niet versturen met WSAC in rooms
- meer wsac shit
- save elke 20 seconden(OK?)
- knop voor notifications?
## Privékanalen
- Beginnen met de limbo als publiek kanaal en aparte privékanalen
- Nieuwe features voor privékanalen :
- Toevoegen van gebruikers (ook in client!)
- > lijst nodig van gebruikers in een bepaald kanaal
- -> lijst nodig van kanalen waarin een gebruiker is ge-add (-> aanpassen wanneer lijst in channel wordt geupdated, zend op wanneer de gebruiker zijn channels opvraag, VERWIJDER ALS CHANNEL VERWIJDERT, VERWIJDER ALS PROFILE VERWIJDERT dus implementeer isInChannel, addToChannel...)
- -> room joinen : check of wel added
- -> iemand toegevoegd : stuur update naar die mens
- -> iemand toevoegen kan enkel als owner
- -> channel verwijderd : notify enkel members en verwijder channel voor elke member
- -> users in channel : zowel online als offline (-> ook update als iemand wordt toegevoegd)
- Mogelijk maken in limbo :
- Berichten sturen (ook in client!)
- User info (ook in client!)
### Aanpassingen langs client
- Aanpassingen in client :
- ontvang group info & users in limbo
- sommige requests ook in limbo kunnen
- vraag channels op bij inloggen (is al zo wrs)
- bij creëren : geen update meer ontvangen
### Limbo
- langs client kant : berichten kunnen sturen als niet in chatroom
- Change protocol : some channel ids may be undefined
- Keep a list of users in the limbo world and update at channelchange and channeldelete and login/create account and logout
## Searching for users
- add jora-winkler score determining (this is like levenshtein distance, but takes length of strings into account and puts more weight on the first characters)
- function lists hundred best matched users
- The score of each user is the maximum score of comparing userid (only if the searchstring starts with '#'!), username and email to the search string
## Chat differentiation (only backend)
- add a 'shout' field to the protocol
- add users in proximity to the protocol
- Server passes this information on to the clients
## Detailed friend and channel users updates
- Not only send the user id's of the friends to the clients, but also all the necessary information about the friends for the UI (in room, online, username,...)
- Update the friend information if one of them joins your channel or leaves and if one of them logs off or logs in, or if a friend request is accepted or removed..
- Fix bug : Update friends and channelusers when one deletes his profile and changes username?
- Fix bug : not all necessary updates were sent about present channel users!
- client receives friend update : copy the requests and accepted lists and update the GUI if needed
### TODO
- Add/fix tests
## Linken UI en backend
### Opmerkingen
- geen room name / id
- Er staat nog steeds 'login page' in chatroom modus
- Geen accept friend / sent friend request ipv add friend
- Buttons worden nog niet geupdated (vb. als je add friend doet)
- Nog geen room creation
- Als profiel waarop je klikt jouw profiel is : geen buttons laten zien
- Ik heb online/offline/in room indicators toegevoegd bij een user profile. Maar er is een probleem : nl. het feit dat je bij een update (vb. fillRoomUserCards), je de reeds bestaande cards niet update terwijl dat soms wel moet (vb. als iemand offline gaat moet het bolletje rood worden)
## Record keystrokes
- create class for each inputbox
- clearing when needed (= when inputbox gets reset)
- Add when needed
- Tests and shite
## Wsac integration into UI
- Pass wsac info to wsac -> Get best result -> Display
- On sending a message : update the databases
- Tab completion
- Prepend
- All the same for DMs
## Live-typing (with DMs)
### Back-end (client object)
- Send updates (with timer or on an update) -> CLIENT!!
- General updates : typing, idle and default
- Typing : when previously idle or default
- Idle : When stopped typing for a period of time
- Default : When the field is empty or the message is sent
- Content updates : When the other user has keystroke permissions
- After some interval of time : send all previously unsent
- In Group : both general and content updates
- When sending a message : end the live typing
### Frontend (2D UI only -> DMs)
- Content updates : show the updates live
- General updates : Show the three dots
- On Message received : Remove the indicators
- Broke alert box
### Frotend (3D UI -> Groups)
- On room change : clear the room live content
- Also remove live content of people leaving
## 3D clientcommunication
- Nog twee extra function
## e2ee
- in client : twee functies
- get public key
```ts=
public getPublicKey() : string
```
- set public key
```ts=
public receivedPublicKey(userId : string)
```
- Henri voegt functionaliteit toe om publick key op te vragen en in te geven
- Opvragen : in settings
- Ingeven : Enkel kunnen chatten wanneer public key van andere in de databse
## Settings
- nog live-typing afzetten
- Nog on click van change name bij open settings
## Hotkeys
- Some possible hotkeys are :
- Go back from create account to login (escape)
- Reset settings (Ctrl+R)
- Close settings (Ctrl+S of escape)
- Apply settings (Ctrl+A)
- Open settings (Ctrl+S)
- Leave room (ctrl+L)
- Logout (escape)
- Focus on main input bar (ctrl+i)
- Sending in the default chat (enter)
- Sending in the non-default chat (ctrl+enter)
- Open left tab (F1)
- Open right tab (F2)
- Cycling trough panels in general and room tab :
- General tab : TAB+leftShift
- Room tab : TAB+rightShift