Don't idle logout if a transfer is making progress
This commit is contained in:
@@ -84,7 +84,7 @@ function Client(/*input, output*/) {
|
||||
|
||||
this.user = new User();
|
||||
this.currentTheme = { info : { name : 'N/A', description : 'None' } };
|
||||
this.lastKeyPressMs = Date.now();
|
||||
this.lastActivityTime = Date.now();
|
||||
this.menuStack = new MenuStack(this);
|
||||
this.acs = new ACS( { client : this, user : this.user } );
|
||||
this.mciCache = {};
|
||||
@@ -406,7 +406,7 @@ function Client(/*input, output*/) {
|
||||
self.log.trace( { key : key, ch : escape(ch) }, 'User keyboard input'); // jshint ignore:line
|
||||
}
|
||||
|
||||
self.lastKeyPressMs = Date.now();
|
||||
self.lastActivityTime = Date.now();
|
||||
|
||||
if(!self.ignoreInput) {
|
||||
self.emit('key press', ch, key);
|
||||
@@ -438,7 +438,7 @@ Client.prototype.startIdleMonitor = function() {
|
||||
this.stopIdleMonitor();
|
||||
}
|
||||
|
||||
this.lastKeyPressMs = Date.now();
|
||||
this.lastActivityTime = Date.now();
|
||||
|
||||
//
|
||||
// Every 1m, check for idle.
|
||||
@@ -476,7 +476,7 @@ Client.prototype.startIdleMonitor = function() {
|
||||
// use override value if set
|
||||
idleLogoutSeconds = this.idleLogoutSecondsOverride || idleLogoutSeconds;
|
||||
|
||||
if(idleLogoutSeconds > 0 && (nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000))) {
|
||||
if(idleLogoutSeconds > 0 && (nowMs - this.lastActivityTime >= (idleLogoutSeconds * 1000))) {
|
||||
this.emit('idle timeout');
|
||||
}
|
||||
}, 1000 * 60);
|
||||
@@ -489,6 +489,10 @@ Client.prototype.stopIdleMonitor = function() {
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.explicitActivityTimeUpdate = function() {
|
||||
this.lastActivityTime = Date.now();
|
||||
}
|
||||
|
||||
Client.prototype.overrideIdleLogoutSeconds = function(seconds) {
|
||||
this.idleLogoutSecondsOverride = seconds;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user