Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Chat now works robustly

  • Loading branch information...
commit d14571f262f69ad100cb56f19cb276cc122e2dec 1 parent 1759d5b
@abhshkdz abhshkdz authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  public/hangout.js
  2. +2 −1  rtc.js
View
3  public/hangout.js
@@ -28,12 +28,13 @@ var Hangout=(function(){
$('video[rel="'+socketId+'"]').remove();
});
rtc.on('receive_chat_msg', function(data){
- UI.addChatMessage(data.msg);
+ UI.addChatMessage(data.nick+": "+data.msg);
})
};
//Sends chat using rtc sockets
function sendChat (message){
+ UI.addChatMessage("me: "+message);
rtc._socket.send(JSON.stringify({
eventName:"chat_msg",
data:{
View
3  rtc.js
@@ -29,7 +29,8 @@ module.exports=(function(webRTC){
soc.send(JSON.stringify({
"eventName": "receive_chat_msg",
"data": {
- "msg": sanitize(data.msg).xss()
+ "msg": sanitize(data.msg).xss(),
+ "nick":sanitize(data.nick).xss()
}
}), function(error) {
if (error) {
Please sign in to comment.
Something went wrong with that request. Please try again.