Remove unnecessary onmessage function

This commit is contained in:
David Cormier 2014-02-09 12:04:26 -05:00
parent eddffd6e63
commit 1b1b97c448

View file

@ -262,7 +262,6 @@ weechat.factory('connection',
} }
}); });
// Send all the other commands required for initialization // Send all the other commands required for initialization
conn.send( conn.send(
weeChat.Protocol.formatHdata({ weeChat.Protocol.formatHdata({
@ -282,7 +281,6 @@ weechat.factory('connection',
handlers.handleHotlistInfo(hotlist); handlers.handleHotlistInfo(hotlist);
}); });
conn.send( conn.send(
weeChat.Protocol.formatNicklist({ weeChat.Protocol.formatNicklist({
}) })
@ -299,7 +297,6 @@ weechat.factory('connection',
}; };
var onclose = function () { var onclose = function () {
$log.info("Disconnected from relay"); $log.info("Disconnected from relay");
$rootScope.connected = false; $rootScope.connected = false;
@ -307,19 +304,6 @@ weechat.factory('connection',
$rootScope.$apply(); $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) { var onerror = function (evt) {
// on error it means the connection problem // on error it means the connection problem
// come from the relay not from the password. // come from the relay not from the password.
@ -331,6 +315,7 @@ weechat.factory('connection',
$log.error("Relay error " + evt.data); $log.error("Relay error " + evt.data);
}; };
protocol.setId = function(id, message) { protocol.setId = function(id, message) {
return '(' + id + ') ' + message; return '(' + id + ') ' + message;
} }