aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/OwnTracksProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-14 21:04:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-06-14 21:04:15 +1200
commit94794f9fc02256a0e4a7a6a37c5fc669277af58b (patch)
treec8462fddd4671ca8d8a1c643cf83cf088c2484fd /src/org/traccar/protocol/OwnTracksProtocolDecoder.java
parente10e10fee9c96cbcd4e79d8616632654df2eed97 (diff)
downloadtrackermap-server-94794f9fc02256a0e4a7a6a37c5fc669277af58b.tar.gz
trackermap-server-94794f9fc02256a0e4a7a6a37c5fc669277af58b.tar.bz2
trackermap-server-94794f9fc02256a0e4a7a6a37c5fc669277af58b.zip
Minor modifications to OwnTracks code
Diffstat (limited to 'src/org/traccar/protocol/OwnTracksProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/OwnTracksProtocolDecoder.java9
1 files changed, 3 insertions, 6 deletions
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;
}
+
}