Implement reconnecting upon connection loss

TODO: test in various conditions
This commit is contained in:
Lorenz Hübschle-Schneider 2014-10-18 12:25:14 +02:00 committed by Lorenz Hübschle-Schneider
commit 849da1b5a2
5 changed files with 142 additions and 16 deletions

View file

@ -263,6 +263,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.connected = false;
$rootScope.waseverconnected = false;
$rootScope.userdisconnect = false;
$rootScope.reconnecting = false;
$rootScope.models = models;
@ -503,6 +505,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$scope.connectbutton = 'Connect';
connection.disconnect();
};
$scope.reconnect = function() {
var bufferId = models.getActiveBuffer().id;
connection.attemptReconnect(bufferId, 3000);
};
//XXX this is a bit out of place here, either move up to the rest of the firefox install code or remove
$scope.install = function() {