|
|
@ -410,6 +410,11 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers', |
|
|
|
this.websocket = websocket; |
|
|
|
this.websocket = websocket; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var disconnect = function() { |
|
|
|
|
|
|
|
console.log(this.websocket); |
|
|
|
|
|
|
|
this.websocket.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var sendMessage = function(message) { |
|
|
|
var sendMessage = function(message) { |
|
|
|
doSend(WeeChatProtocol.formatInput({ |
|
|
|
doSend(WeeChatProtocol.formatInput({ |
|
|
|
buffer: models.getActiveBuffer()['fullName'], |
|
|
|
buffer: models.getActiveBuffer()['fullName'], |
|
|
@ -421,6 +426,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers', |
|
|
|
return { |
|
|
|
return { |
|
|
|
send: doSend, |
|
|
|
send: doSend, |
|
|
|
connect: connect, |
|
|
|
connect: connect, |
|
|
|
|
|
|
|
disconnect: disconnect, |
|
|
|
sendMessage: sendMessage |
|
|
|
sendMessage: sendMessage |
|
|
|
} |
|
|
|
} |
|
|
|
}]); |
|
|
|
}]); |
|
|
@ -509,6 +515,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
$scope.connect = function() { |
|
|
|
$scope.connect = function() { |
|
|
|
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); |
|
|
|
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$scope.discconnect = function() { |
|
|
|
|
|
|
|
connection.disconnect(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Function gets called from bufferLineAdded code if user should be notified */ |
|
|
|
/* Function gets called from bufferLineAdded code if user should be notified */ |
|
|
|
$rootScope.createHighlight = function(buffer, message) { |
|
|
|
$rootScope.createHighlight = function(buffer, message) { |
|
|
|