diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-04 14:52:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-04 14:52:42 +1300 |
commit | 6dbe4dfd44c7acda448fbda279b0f0a088c76489 (patch) | |
tree | 571e8c4153aa2fdaeedebaf307475131318f5d96 /src | |
parent | d8d5f0277a342e7254c465d209725dd362554e58 (diff) | |
download | traccar-server-6dbe4dfd44c7acda448fbda279b0f0a088c76489.tar.gz traccar-server-6dbe4dfd44c7acda448fbda279b0f0a088c76489.tar.bz2 traccar-server-6dbe4dfd44c7acda448fbda279b0f0a088c76489.zip |
Alarm types filtering option
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/database/NotificationManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 60f7f4e4f..09df4c571 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -90,7 +90,16 @@ public class NotificationManager extends ExtendedObjectManager<Notification> { for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { - notificators.addAll(notification.getNotificatorsTypes()); + boolean filter = false; + if (event.getType().equals(Event.TYPE_ALARM)) { + String alarms = notification.getString("alarms"); + if (alarms == null || !alarms.contains(event.getString(Position.KEY_ALARM))) { + filter = true; + } + } + if (!filter) { + notificators.addAll(notification.getNotificatorsTypes()); + } } } for (String notificator : notificators) { |