From b580bf533b6f74749b96adf3652f5584425abe69 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 18 Dec 2016 10:32:02 +1300 Subject: Do not send position with events --- src/org/traccar/api/AsyncSocket.java | 5 +---- src/org/traccar/database/ConnectionManager.java | 6 +++--- src/org/traccar/database/NotificationManager.java | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/api/AsyncSocket.java b/src/org/traccar/api/AsyncSocket.java index 7ac3810fa..b12d5d252 100644 --- a/src/org/traccar/api/AsyncSocket.java +++ b/src/org/traccar/api/AsyncSocket.java @@ -76,12 +76,9 @@ public class AsyncSocket extends WebSocketAdapter implements ConnectionManager.U } @Override - public void onUpdateEvent(Event event, Position position) { + public void onUpdateEvent(Event event) { Map> data = new HashMap<>(); data.put(KEY_EVENTS, Collections.singletonList(event)); - if (position != null) { - data.put(KEY_POSITIONS, Collections.singletonList(position)); - } sendData(data); } diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index bc44c31ae..374e9651d 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -146,10 +146,10 @@ public class ConnectionManager { } } - public synchronized void updateEvent(long userId, Event event, Position position) { + public synchronized void updateEvent(long userId, Event event) { if (listeners.containsKey(userId)) { for (UpdateListener listener : listeners.get(userId)) { - listener.onUpdateEvent(event, position); + listener.onUpdateEvent(event); } } } @@ -157,7 +157,7 @@ public class ConnectionManager { public interface UpdateListener { void onUpdateDevice(Device device); void onUpdatePosition(Position position); - void onUpdateEvent(Event event, Position position); + void onUpdateEvent(Event event); } public synchronized void addListener(long userId, UpdateListener listener) { diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index ee804f5cd..4ae173c6a 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -60,7 +60,7 @@ public class NotificationManager { Notification notification = getUserNotificationByType(userId, event.getType()); if (notification != null) { if (notification.getWeb()) { - Context.getConnectionManager().updateEvent(userId, event, position); + Context.getConnectionManager().updateEvent(userId, event); } if (notification.getMail()) { NotificationMail.sendMailAsync(userId, event, position); -- cgit v1.2.3