diff options
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-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) { |