aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/NotificationManager.java
diff options
context:
space:
mode:
authorParveen Kumar Yadav <parveenkumardeeva@gmail.com>2018-04-13 10:47:42 +0530
committerGitHub <noreply@github.com>2018-04-13 10:47:42 +0530
commitd448823edd0e8a7833c79b980cfe9778b849843a (patch)
tree50ad1ab51b93915cff422a1834baa5a2c579fce8 /src/org/traccar/database/NotificationManager.java
parent2c8392a0e16044905d983da56ab0919eadbb3858 (diff)
parent617393cf9f052298f7fb35f0c58138c87a6dd5c3 (diff)
downloadtraccar-server-d448823edd0e8a7833c79b980cfe9778b849843a.tar.gz
traccar-server-d448823edd0e8a7833c79b980cfe9778b849843a.tar.bz2
traccar-server-d448823edd0e8a7833c79b980cfe9778b849843a.zip
Merge pull request #1 from traccar/master
Bringing Fork Up to Date
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-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);
}
}