aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/NotificationManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-11-14 14:38:50 +0500
committerAbyss777 <abyss@fox5.ru>2017-11-14 14:38:50 +0500
commit31ebe3cd08a28890136cab5804903a7cf397aad6 (patch)
treeb4828643e434123232a37c73b731526879834583 /src/org/traccar/database/NotificationManager.java
parente48863c91dd049315e5ad336e5950e911cac5495 (diff)
downloadtrackermap-server-31ebe3cd08a28890136cab5804903a7cf397aad6.tar.gz
trackermap-server-31ebe3cd08a28890136cab5804903a7cf397aad6.tar.bz2
trackermap-server-31ebe3cd08a28890136cab5804903a7cf397aad6.zip
Do geocoding for every events related positions
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-rw-r--r--src/org/traccar/database/NotificationManager.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java
index 73041a23f..4e6114001 100644
--- a/src/org/traccar/database/NotificationManager.java
+++ b/src/org/traccar/database/NotificationManager.java
@@ -35,8 +35,11 @@ import org.traccar.notification.NotificationSms;
public class NotificationManager extends ExtendedObjectManager<Notification> {
+ private boolean geocodeOnRequest;
+
public NotificationManager(DataManager dataManager) {
super(dataManager, Notification.class);
+ geocodeOnRequest = Context.getConfig().getBoolean("geocoder.onRequest");
}
private Set<Long> getEffectiveNotifications(long userId, long deviceId) {
@@ -57,6 +60,11 @@ public class NotificationManager extends ExtendedObjectManager<Notification> {
Log.warning(error);
}
+ if (position != null && geocodeOnRequest && Context.getGeocoder() != null && position.getAddress() == null) {
+ position.setAddress(Context.getGeocoder()
+ .getAddress(position.getLatitude(), position.getLongitude(), null));
+ }
+
long deviceId = event.getDeviceId();
Set<Long> users = Context.getPermissionsManager().getDeviceUsers(deviceId);
for (long userId : users) {