aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/WebDataHandler.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index 3e47ada70..49033fc3a 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,7 +140,16 @@ public class WebDataHandler extends BaseDataHandler {
request = request.replace("{gprmc}", formatSentence(position));
}
- return request;
+ String deviceGroupName = "";
+
+ if (device.getGroupId() != 0) {
+ Group group = Context.getGroupsManager().getById(device.getGroupId());
+ if (group != null) {
+ deviceGroupName = group.getName();
+ }
+ }
+
+ return request.replace("{group}", URLEncoder.encode(deviceGroupName, StandardCharsets.UTF_8.name()));
}
@Override