Skip to content

Commit

Permalink
Made Notifier.Notification private
Browse files Browse the repository at this point in the history
External plugins/addons shouldn't have had access to this inner class.
  • Loading branch information
Poslovitch committed Sep 1, 2018
1 parent 678e699 commit 8e7843d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/world/bentobox/bentobox/api/user/Notifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public synchronized boolean notify(User user, String message) {
try {
Notification lastNotification = notificationCache.get(user);
long now = System.currentTimeMillis();
if (now >= lastNotification.getTime() + NOTIFICATION_DELAY * 1000 || !message.equals(lastNotification.getMessage())) {

if (now >= lastNotification.getTime() + (NOTIFICATION_DELAY * 1000) || !message.equals(lastNotification.getMessage())) {
notificationCache.put(user, new Notification(message, now));
user.sendRawMessage(message);
return true;
Expand All @@ -51,11 +52,11 @@ public synchronized boolean notify(User user, String message) {
}
}

public class Notification {
private class Notification {
private final String message;
private final long time;

public Notification(String message, long time) {
private Notification(String message, long time) {
this.message = message;
this.time = time;
}
Expand Down

0 comments on commit 8e7843d

Please sign in to comment.