From 1b1b97c448712854ebb1ad55071651da7079ab59 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sun, 9 Feb 2014 12:04:26 -0500 Subject: [PATCH] Remove unnecessary onmessage function --- js/glowingbear.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 670534b..0cc600e 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -262,7 +262,6 @@ weechat.factory('connection', } }); - // Send all the other commands required for initialization conn.send( weeChat.Protocol.formatHdata({ @@ -282,7 +281,6 @@ weechat.factory('connection', handlers.handleHotlistInfo(hotlist); }); - conn.send( weeChat.Protocol.formatNicklist({ }) @@ -299,7 +297,6 @@ weechat.factory('connection', }; - var onclose = function () { $log.info("Disconnected from relay"); $rootScope.connected = false; @@ -307,19 +304,6 @@ weechat.factory('connection', $rootScope.$apply(); }; - var onmessage = function (evt) { - message = protocol.parse(evt.data); - if (_.has(callbacks, message.id)) { - var promise = callbacks[message.id]; - promise.cb.resolve(message); - delete(callbacks[message.id]); - } else { - handlers.handleEvent(message); - } - $rootScope.commands.push("RECV: " + evt.data + " TYPE:" + evt.type); - $rootScope.$apply(); - }; - var onerror = function (evt) { // on error it means the connection problem // come from the relay not from the password. @@ -331,6 +315,7 @@ weechat.factory('connection', $log.error("Relay error " + evt.data); }; + protocol.setId = function(id, message) { return '(' + id + ') ' + message; }