diff options
author | Abyss777 <abyss@fox5.ru> | 2016-06-02 11:54:13 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-06-02 11:54:13 +0500 |
commit | bf296b4af4714a3fe62cd6f9fcff8ac29fcd0178 (patch) | |
tree | 93ca4a4e78d7313c4d14aac8332a818c5ad1f327 /src/org/traccar/database/ConnectionManager.java | |
parent | 06a746b44dae69b0c84a5302f92a1bcbe2dc827f (diff) | |
download | trackermap-server-bf296b4af4714a3fe62cd6f9fcff8ac29fcd0178.tar.gz trackermap-server-bf296b4af4714a3fe62cd6f9fcff8ac29fcd0178.tar.bz2 trackermap-server-bf296b4af4714a3fe62cd6f9fcff8ac29fcd0178.zip |
Send position with event to websocket
Diffstat (limited to 'src/org/traccar/database/ConnectionManager.java')
-rw-r--r-- | src/org/traccar/database/ConnectionManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index 9e0da8485..ec5903548 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -94,7 +94,7 @@ public class ConnectionManager { if (status.equals(Device.STATUS_ONLINE)) { event.setType(Event.TYPE_DEVICE_ONLINE); } - updateEvent(event); + updateEvent(event, null); } device.setStatus(status); @@ -147,7 +147,7 @@ public class ConnectionManager { } } - public synchronized void updateEvent(Event event) { + public synchronized void updateEvent(Event event, Position position) { long deviceId = event.getDeviceId(); try { Context.getDataManager().addEvent(event); @@ -157,7 +157,7 @@ public class ConnectionManager { for (long userId : Context.getPermissionsManager().getDeviceUsers(deviceId)) { if (listeners.containsKey(userId)) { for (UpdateListener listener : listeners.get(userId)) { - listener.onUpdateEvent(event); + listener.onUpdateEvent(event, position); } } } @@ -183,7 +183,7 @@ public class ConnectionManager { public interface UpdateListener { void onUpdateDevice(Device device); void onUpdatePosition(Position position); - void onUpdateEvent(Event event); + void onUpdateEvent(Event event, Position position); } public synchronized void addListener(long userId, UpdateListener listener) { |