From 94794f9fc02256a0e4a7a6a37c5fc669277af58b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 14 Jun 2017 21:04:15 +1200 Subject: Minor modifications to OwnTracks code --- src/org/traccar/protocol/OwnTracksProtocolDecoder.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/OwnTracksProtocolDecoder.java b/src/org/traccar/protocol/OwnTracksProtocolDecoder.java index a5a9efbb4..f664d113b 100644 --- a/src/org/traccar/protocol/OwnTracksProtocolDecoder.java +++ b/src/org/traccar/protocol/OwnTracksProtocolDecoder.java @@ -1,6 +1,6 @@ /* * Copyright 2017 Jan-Piet Mens (jpmens@gmail.com) - * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,11 +87,7 @@ public class OwnTracksProtocolDecoder extends BaseProtocolDecoder { position.set("topic", root.getString("topic")); } - long timestamp = root.getJsonNumber("tst").longValue(); - if (timestamp < Integer.MAX_VALUE) { - timestamp *= 1000; - } - position.setTime(new Date(timestamp)); + position.setTime(new Date(root.getJsonNumber("tst").longValue() * 1000)); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, root.getString("tid")); if (deviceSession == null) { @@ -103,4 +99,5 @@ public class OwnTracksProtocolDecoder extends BaseProtocolDecoder { sendResponse(channel, HttpResponseStatus.OK); return position; } + } -- cgit v1.2.3