Add 10 seconds of graceful time before doing first check to prevent misinterpretation of lack of activity.

This commit is contained in:
Ali Moghnieh 2016-01-02 10:16:34 +00:00
parent c56dd6e302
commit 06417910e2
1 changed files with 5 additions and 0 deletions

View File

@ -494,6 +494,11 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
}
public void checkActivity() {
// Graceful time before the first afk check call.
if (System.currentTimeMillis() - lastActivity <= 10000) {
return;
}
final long autoafkkick = ess.getSettings().getAutoAfkKick();
if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis() && !isHidden() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt")) {
final String kickReason = tl("autoAfkKickReason", autoafkkick / 60.0);