Properly reset idle timers on logout and login
When someone logs out, reset all timers to not have sent the notifications after they are no longer relevant. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -206,6 +206,9 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
case LOGIN_SCREEN:
|
||||||
|
resetTimers();
|
||||||
|
break;
|
||||||
case LOGGING_IN:
|
case LOGGING_IN:
|
||||||
case HOPPING:
|
case HOPPING:
|
||||||
case CONNECTION_LOST:
|
case CONNECTION_LOST:
|
||||||
@@ -216,7 +219,9 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
sixHourWarningTime = Instant.now().plus(SIX_HOUR_LOGOUT_WARNING_AFTER_DURATION);
|
sixHourWarningTime = Instant.now().plus(SIX_HOUR_LOGOUT_WARNING_AFTER_DURATION);
|
||||||
ready = false;
|
ready = false;
|
||||||
|
resetTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user