Expose IUser#getLastActivityTime to API (#6101)

This commit is contained in:
maxcom1 2025-03-24 17:29:06 +01:00 committed by GitHub
parent 46ba679c02
commit 40540ebb3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -177,6 +177,17 @@ public interface IUser {
String getFormattedJailTime();
/**
* Returns last activity time.
* <p>
* It is used internally to determine if user's afk status should be set to
* true because of ACTIVITY {@link AfkStatusChangeEvent.Cause}, or the player
* should be kicked for being afk too long.
*
* @return Last activity time (Epoch Milliseconds)
*/
long getLastActivityTime();
@Deprecated
List<String> getMails();

View File

@ -775,6 +775,11 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
return false;
}
@Override
public long getLastActivityTime() {
return this.lastActivity;
}
@Deprecated
public void updateActivity(final boolean broadcast) {
updateActivity(broadcast, AfkStatusChangeEvent.Cause.UNKNOWN);