From 02e3f0f196c9dc1227b1074ff39f52efd7ab418c Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 20 Mar 2018 16:30:08 +0500 Subject: Add user objects to Event forward payload --- src/org/traccar/database/NotificationManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/database/NotificationManager.java') 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 { long deviceId = event.getDeviceId(); Set users = Context.getPermissionsManager().getDeviceUsers(deviceId); + Set 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 { } } if (Context.getEventForwarder() != null) { - Context.getEventForwarder().forwardEvent(event, position); + Context.getEventForwarder().forwardEvent(event, position, usersToForward); } } -- cgit v1.2.3