aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notificators
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-09 21:50:41 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-06-09 21:50:48 -0700
commit2202e638a37e221c16b869465bbeebdfb3a72b20 (patch)
tree19ad44ecbe4b0e2128a269334475d26d6e460a91 /src/main/java/org/traccar/notificators
parent7ce5bb1f5491b85ea1e6ffd095c68b8d02bb831e (diff)
downloadtrackermap-server-2202e638a37e221c16b869465bbeebdfb3a72b20.tar.gz
trackermap-server-2202e638a37e221c16b869465bbeebdfb3a72b20.tar.bz2
trackermap-server-2202e638a37e221c16b869465bbeebdfb3a72b20.zip
Fix Telegram notifications (fix #4690)
Diffstat (limited to 'src/main/java/org/traccar/notificators')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorTelegram.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorTelegram.java b/src/main/java/org/traccar/notificators/NotificatorTelegram.java
index 963bdb091..cd6fb0c45 100644
--- a/src/main/java/org/traccar/notificators/NotificatorTelegram.java
+++ b/src/main/java/org/traccar/notificators/NotificatorTelegram.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2019 - 2021 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.
@@ -93,13 +93,13 @@ public class NotificatorTelegram extends Notificator {
@Override
public void sendSync(long userId, Event event, Position position) {
- if (position != null) {
- executeRequest(urlSendLocation, createLocationMessage(position));
- }
TextMessage message = new TextMessage();
message.chatId = chatId;
- message.text = NotificationFormatter.formatFullMessage(userId, event, position).getBody();
+ message.text = NotificationFormatter.formatShortMessage(userId, event, position);
executeRequest(urlSendText, message);
+ if (position != null) {
+ executeRequest(urlSendLocation, createLocationMessage(position));
+ }
}
@Override