aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notificators
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-13 09:39:22 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-13 09:39:22 -0700
commit33733f835e88a62c4a5259ab330723b88037adf1 (patch)
treef12c710dc4dd6c21a1434f3d699a2fcdd76bb0fa /src/main/java/org/traccar/notificators
parentadbeacc62ecb91c94f6cfe7dea8e79b8f5e1c802 (diff)
downloadtrackermap-server-33733f835e88a62c4a5259ab330723b88037adf1.tar.gz
trackermap-server-33733f835e88a62c4a5259ab330723b88037adf1.tar.bz2
trackermap-server-33733f835e88a62c4a5259ab330723b88037adf1.zip
Simplify attribute check
Diffstat (limited to 'src/main/java/org/traccar/notificators')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorFirebase.java2
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorPushover.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
index 5787b7ef2..17a6735ee 100644
--- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java
+++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
@@ -69,7 +69,7 @@ public class NotificatorFirebase implements Notificator {
@Override
public void send(User user, Event event, Position position) {
- if (user.getAttributes().containsKey("notificationTokens")) {
+ if (user.hasAttribute("notificationTokens")) {
var shortMessage = notificationFormatter.formatMessage(user, event, position, "short");
diff --git a/src/main/java/org/traccar/notificators/NotificatorPushover.java b/src/main/java/org/traccar/notificators/NotificatorPushover.java
index 32ceae780..671984f86 100644
--- a/src/main/java/org/traccar/notificators/NotificatorPushover.java
+++ b/src/main/java/org/traccar/notificators/NotificatorPushover.java
@@ -65,7 +65,7 @@ public class NotificatorPushover implements Notificator {
public void send(User user, Event event, Position position) {
String device = "";
- if (user.getAttributes().containsKey("notificator.pushover.device")) {
+ if (user.hasAttribute("notificator.pushover.device")) {
device = user.getString("notificator.pushover.device").replaceAll(" *, *", ",");
}