diff options
Diffstat (limited to 'src/main/java/org/traccar/session/ConnectionManager.java')
-rw-r--r-- | src/main/java/org/traccar/session/ConnectionManager.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java index 2d183ee22..262a302af 100644 --- a/src/main/java/org/traccar/session/ConnectionManager.java +++ b/src/main/java/org/traccar/session/ConnectionManager.java @@ -189,12 +189,14 @@ public class ConnectionManager implements BroadcastInterface { } } - public void deviceDisconnected(Channel channel) { + public void deviceDisconnected(Channel channel, boolean supportsOffline) { Endpoint endpoint = new Endpoint(channel, channel.remoteAddress()); Map<String, DeviceSession> endpointSessions = sessionsByEndpoint.remove(endpoint); if (endpointSessions != null) { for (DeviceSession deviceSession : endpointSessions.values()) { - updateDevice(deviceSession.getDeviceId(), Device.STATUS_OFFLINE, null); + if (supportsOffline) { + updateDevice(deviceSession.getDeviceId(), Device.STATUS_OFFLINE, null); + } sessionsByDeviceId.remove(deviceSession.getDeviceId()); cacheManager.removeDevice(deviceSession.getDeviceId()); } |