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
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