mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-28 13:36:16 +02:00
Don't idle logout if a transfer is making progress
This commit is contained in:
parent
59ee52ea6f
commit
387dfb3b5d
2 changed files with 19 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue