From 15b6a584ed20c8ad43c587ede8ebb0393bf3f4aa Mon Sep 17 00:00:00 2001 From: Max Dietz Date: Thu, 22 Jan 2015 21:01:46 -0500 Subject: [PATCH] fix --- tp6/src/script/server.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tp6/src/script/server.js b/tp6/src/script/server.js index fdc883f..b3a2d5c 100644 --- a/tp6/src/script/server.js +++ b/tp6/src/script/server.js @@ -38,10 +38,7 @@ var _this = this; this.websock = new Tp.Websock(); this.websock.bind("message", function(msg) { - if (!msg.room || msg.room == parse('room_id')) { - return _this.handle_msg(msg); - } - return null; + return _this.handle_msg(msg); }); this.websock.bind("disconnected", function() { return $('#lost-connection').show(); @@ -136,10 +133,12 @@ case "connection": return this.connected(msg); case "state_changed": - if (msg['resource'] === 'source') { - return this.source_changed(msg); - } else { - return this.device_changed(msg); + if (msg['room'] === parse('room_id')) { + if (msg['resource'] === 'source') { + return this.source_changed(msg); + } else { + return this.device_changed(msg); + } } break; case "ack":