bcwaters / MinusMail

Temporary email available in your browser
0 stars 0 forks source link

Backend Update filewatcher.js to determine recipient and only emit corresponding clients #2

Closed bcwaters closed 5 years ago

bcwaters commented 5 years ago

At the moment all emails are displayed to all connected users. Filewatcher needs to determine who the email is going to and then only emit to that clients socket. It is likely that the class needs to be refactored so that a socket is not passed into the class. Instead use a callback method where server.js can determine who to emit to.

Eventually writing files to the directory won't be good enough and a database will be needed. Look into Redis for a pub-sub solution