diff options
author | Shinryuken <watertext@hotmail.it> | 2017-11-19 11:22:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-19 11:22:31 +0100 |
commit | a5b273f8f8afd1a67613517c6487642601070456 (patch) | |
tree | babc63f5d50977fc91b3946b1da2e86ec74c51a5 /src/org/traccar/database/NotificationManager.java | |
parent | c7928ef4a722cb40e9911c8e76e308fc48c85567 (diff) | |
parent | fb9cbb2b74dc0060bd0dc5d0b3bfeb958ed6f3b5 (diff) | |
download | trackermap-server-a5b273f8f8afd1a67613517c6487642601070456.tar.gz trackermap-server-a5b273f8f8afd1a67613517c6487642601070456.tar.bz2 trackermap-server-a5b273f8f8afd1a67613517c6487642601070456.zip |
Merge branch 'master' into payload-as-form-param
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-rw-r--r-- | src/org/traccar/database/NotificationManager.java | 8 |
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) { |