aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-12-17 13:27:47 -0800
committerGitHub <noreply@github.com>2018-12-17 13:27:47 -0800
commit37f4de0072897189ac52bebe3defe2c7471979ed (patch)
tree3127ca9efd21a475316f6b22c277f0b464883659 /src
parent56d33dbe0e79789fc1ee78e3358c3531c2f16381 (diff)
parent4a634885212d80f5e2c7dd5ca0847fac287d02b9 (diff)
downloadtrackermap-server-37f4de0072897189ac52bebe3defe2c7471979ed.tar.gz
trackermap-server-37f4de0072897189ac52bebe3defe2c7471979ed.tar.bz2
trackermap-server-37f4de0072897189ac52bebe3defe2c7471979ed.zip
Merge pull request #4165 from iEvgeny/master
Added group arg to forwarding
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/WebDataHandler.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index 3e47ada70..a8e20c698 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -24,6 +24,7 @@ import org.traccar.database.IdentityManager;
import org.traccar.helper.Checksum;
import org.traccar.model.Device;
import org.traccar.model.Position;
+import org.traccar.model.Group;
import javax.inject.Inject;
import javax.ws.rs.client.Client;
@@ -139,6 +140,18 @@ public class WebDataHandler extends BaseDataHandler {
request = request.replace("{gprmc}", formatSentence(position));
}
+ if (request.contains("{group}")) {
+ String deviceGroupName = "";
+ if (device.getGroupId() != 0) {
+ Group group = Context.getGroupsManager().getById(device.getGroupId());
+ if (group != null) {
+ deviceGroupName = group.getName();
+ }
+ }
+
+ request = request.replace("{group}", URLEncoder.encode(deviceGroupName, StandardCharsets.UTF_8.name()));
+ }
+
return request;
}