aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-06-24 21:38:32 +1200
committerGitHub <noreply@github.com>2016-06-24 21:38:32 +1200
commit5b254b93fef12f39b0782bbc94d5f280e680900c (patch)
treec2296ba2461ffc7d33bebb034468e56a5511defc /src/org/traccar/database
parent25e323de26718d349999873196bc5c3f5d70eaae (diff)
parent52e7002ed39c333884529c3a0e8b4c6d23f0115e (diff)
downloadtrackermap-server-5b254b93fef12f39b0782bbc94d5f280e680900c.tar.gz
trackermap-server-5b254b93fef12f39b0782bbc94d5f280e680900c.tar.bz2
trackermap-server-5b254b93fef12f39b0782bbc94d5f280e680900c.zip
Merge pull request #2044 from Abyss777/master
Possibility to disable event and geofences
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/ConnectionManager.java4
-rw-r--r--src/org/traccar/database/NotificationManager.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java
index 8a1debdfa..8796673b1 100644
--- a/src/org/traccar/database/ConnectionManager.java
+++ b/src/org/traccar/database/ConnectionManager.java
@@ -94,7 +94,9 @@ public class ConnectionManager {
if (status.equals(Device.STATUS_ONLINE)) {
event.setType(Event.TYPE_DEVICE_ONLINE);
}
- Context.getNotificationManager().updateEvent(event, null);
+ if (Context.getNotificationManager() != null) {
+ Context.getNotificationManager().updateEvent(event, null);
+ }
}
device.setStatus(status);
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java
index 7593367a3..ab6b2230a 100644
--- a/src/org/traccar/database/NotificationManager.java
+++ b/src/org/traccar/database/NotificationManager.java
@@ -41,8 +41,8 @@ public class NotificationManager {
Set<Long> users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId());
for (Long userId : users) {
- if (event.getGeofenceId() == 0
- || Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) {
+ if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null
+ && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) {
Context.getConnectionManager().updateEvent(userId, event, position);
}
}