Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit c2d398c

Browse files
author
Ricardo Malta
committed
bugfix:
Frontend connection to the proper socket.io host and port Send the history mesages just for the new user, avoiding a broadcast
1 parent d9c956f commit c2d398c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/socket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = (server, callback) => {
2525
}
2626
let messagesByGroup = _.groupBy(messages, 'Room');
2727
for (let room in messagesByGroup) {
28-
io.to(room).emit('messages', messagesByGroup[room].map((m) => { return m }));
28+
io.to(socket.id).emit('messages', messagesByGroup[room].map((m) => { return m }));
2929
}
3030
});
3131
});

lib/views/index.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<script type="text/javascript" src="/js/app.js"></script>
6060
<script>
6161
(function(){
62-
App("http://<%= config.web.host %>:<%= config.web.port %>");
62+
App("//");
6363
})();
6464
</script>
6565
</body>

0 commit comments

Comments
 (0)