diff options
author | Khaksar Weqar <wkhaksar1@gmail.com> | 2021-11-02 16:22:03 +0100 |
---|---|---|
committer | Khaksar Weqar <wkhaksar1@gmail.com> | 2021-11-02 16:22:03 +0100 |
commit | 12b26830b3eae6fac9e87c462fc09cfe6c962964 (patch) | |
tree | bc852a5f7c48b99108be4462a037251d6d384cd9 /src/main/java/org/traccar/notificators/NotificatorPushover.java | |
parent | f686847115097cf388a775fad6f13b8bf6893193 (diff) | |
download | traccar-server-12b26830b3eae6fac9e87c462fc09cfe6c962964.tar.gz traccar-server-12b26830b3eae6fac9e87c462fc09cfe6c962964.tar.bz2 traccar-server-12b26830b3eae6fac9e87c462fc09cfe6c962964.zip |
short-message-title-from-templates
Diffstat (limited to 'src/main/java/org/traccar/notificators/NotificatorPushover.java')
-rw-r--r-- | src/main/java/org/traccar/notificators/NotificatorPushover.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorPushover.java b/src/main/java/org/traccar/notificators/NotificatorPushover.java index 189af7834..e541ea525 100644 --- a/src/main/java/org/traccar/notificators/NotificatorPushover.java +++ b/src/main/java/org/traccar/notificators/NotificatorPushover.java @@ -24,6 +24,7 @@ import org.traccar.model.Event; import org.traccar.model.Position; import org.traccar.model.User; import org.traccar.notification.NotificationFormatter; +import org.traccar.notification.ShortMessage; import javax.ws.rs.client.Entity; import javax.ws.rs.client.InvocationCallback; @@ -43,6 +44,8 @@ public class NotificatorPushover extends Notificator { private String user; @JsonProperty("device") private String device; + @JsonProperty("title") + private String title; @JsonProperty("message") private String message; } @@ -74,11 +77,14 @@ public class NotificatorPushover extends Notificator { return; } + ShortMessage shortMessage = NotificationFormatter.formatShortMessage(userId, event, position); + Message message = new Message(); message.token = token; message.user = this.user; message.device = device; - message.message = NotificationFormatter.formatShortMessage(userId, event, position); + message.title= shortMessage.getTitle(); + message.message = shortMessage.getBody(); Context.getClient().target(url).request() .async().post(Entity.json(message), new InvocationCallback<Object>() { |