Nextrek
Diff Revisions 1128 vs 1129 for /socketIO/public/index.html
@@ -91,6 +91,17 @@ | |||
91 | 91 | socket.on('SEND:MESSAGE', (data) => { | |
92 | 92 | uiDisplayMessage(data); | |
93 | 93 | }); | |
94 | + | ||
95 | + | // user left | |
96 | + | socket.on('ROOM:LEAVE', (user) => { | |
97 | + | const content = { | |
98 | + | content: user.name + ' left the room.', | |
99 | + | contentType: 'TEXT', | |
100 | + | room: user.room, | |
101 | + | from: user | |
102 | + | } | |
103 | + | uiDisplayMessage(content); | |
104 | + | }); | |
94 | 105 | </script> | |
95 | 106 | </head> | |
96 | 107 | <body> |