aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-03-21 08:52:57 +1300
committerGitHub <noreply@github.com>2018-03-21 08:52:57 +1300
commit8c1bf38ae5dc6cf76ef532132acda7984b7bc557 (patch)
tree9eaca738af355bc2c92471820080c871c1bd0d2a /src/org/traccar/database
parent38c1ff9bccc1c417a0c2b412271aa7240a3b7db7 (diff)
parent02e3f0f196c9dc1227b1074ff39f52efd7ab418c (diff)
downloadtrackermap-server-8c1bf38ae5dc6cf76ef532132acda7984b7bc557.tar.gz
trackermap-server-8c1bf38ae5dc6cf76ef532132acda7984b7bc557.tar.bz2
trackermap-server-8c1bf38ae5dc6cf76ef532132acda7984b7bc557.zip
Merge pull request #3815 from Abyss777/event_forward_users
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);
}
}