aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-03-20 16:30:08 +0500
committerAbyss777 <abyss@fox5.ru>2018-03-20 16:30:08 +0500
commit02e3f0f196c9dc1227b1074ff39f52efd7ab418c (patch)
tree9eaca738af355bc2c92471820080c871c1bd0d2a /src/org/traccar/database
parent38c1ff9bccc1c417a0c2b412271aa7240a3b7db7 (diff)
downloadtrackermap-server-02e3f0f196c9dc1227b1074ff39f52efd7ab418c.tar.gz
trackermap-server-02e3f0f196c9dc1227b1074ff39f52efd7ab418c.tar.bz2
trackermap-server-02e3f0f196c9dc1227b1074ff39f52efd7ab418c.zip
Add user objects to Event forward payload
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/NotificationManager.java9
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);
}
}