diff options
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-rw-r--r-- | src/org/traccar/database/NotificationManager.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 34c39e8ab..1c59a8666 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -73,9 +73,16 @@ public class NotificationManager extends ExtendedObjectManager<Notification> { long deviceId = event.getDeviceId(); Set<Long> users = Context.getPermissionsManager().getDeviceUsers(deviceId); + Set<Long> usersToForward = null; + if (Context.getEventForwarder() != null) { + usersToForward = new HashSet<>(); + } for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) { + if (usersToForward != null) { + usersToForward.add(userId); + } boolean sentWeb = false; boolean sentMail = false; boolean sentSms = Context.getSmppManager() == null; @@ -102,7 +109,7 @@ public class NotificationManager extends ExtendedObjectManager<Notification> { } } if (Context.getEventForwarder() != null) { - Context.getEventForwarder().forwardEvent(event, position); + Context.getEventForwarder().forwardEvent(event, position, usersToForward); } } |