Group all messaging commands
This commit is contained in:
parent
8167b25c36
commit
75e8c87f09
|
@ -206,6 +206,18 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
|
|||
return defer;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fails every currently subscribed callback for the
|
||||
* given reason
|
||||
* @param reason reason for failure
|
||||
*/
|
||||
failCallbacks = function(reason) {
|
||||
for(i in callbacks) {
|
||||
callbacks[i].cb.reject(reason);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var send = function(message) {
|
||||
message.replace(/[\r\n]+$/g, "").split("\n");
|
||||
var cb = createCallback(message);
|
||||
|
@ -213,7 +225,6 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
|
|||
return cb.promise;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send all messages to the websocket and returns a promise that is resolved
|
||||
* when all message are resolved.
|
||||
|
@ -310,21 +321,6 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Fails every currently subscribed callback for the
|
||||
* given reason
|
||||
* @param reason reason for failure
|
||||
*/
|
||||
failCallbacks = function(reason) {
|
||||
for(i in callbacks) {
|
||||
callbacks[i].cb.reject(reason);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
websocket.onclose = function (evt) {
|
||||
|
|
Loading…
Reference in New Issue