diff --git a/index.js b/index.js index fecaaafa1856641ccf3d12a6ecb01158f9e98e28..316a35787312e3f36146f2d3915cfe4226c93f02 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ io.on('connection', (socket) => { }); }); - + // when disconnecting from chatroom socket.on('disconnect', (response) => { @@ -103,6 +103,8 @@ io.on('connection', (socket) => { var receiver = response.receiver; var sender = response.name; + activeUsers. + io.emit(receiver, { private_msg: private_msg, receiver: receiver, diff --git a/views/index.html b/views/index.html index 05a37bd05f71b5464aa8bf73512cd79664f96534..41b9dd44a7c8f3b038b1406fc528de65f08d0909 100644 --- a/views/index.html +++ b/views/index.html @@ -37,10 +37,15 @@ <input id="input" autocomplete="off" /><button>Send</button> </form> <form id="form_private" action=""> - <input id="input_private" autocomplete="off" /> + <input id="input_private" autocomplete="off" placeholder="Private Message"/> <input id="input_private_reciever" autocomplete="off" placeholder="Receiver"/> <button>Send private Message</button> </form> + <form id="form_multiple_receiver" action=""> + <input id="input_multiple_receiver" autocomplete="off" placeholder="Private Message"/> + <input id="input_multiple_receiver" autocomplete="off" placeholder="Receiver"/> + <button>Send group message</button> + </form> <input id="file" type="file"/> <script src="/socket.io/socket.io.js"></script> <script>