From 2202e638a37e221c16b869465bbeebdfb3a72b20 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 9 Jun 2021 21:50:41 -0700 Subject: Fix Telegram notifications (fix #4690) --- .../java/org/traccar/notificators/NotificatorTelegram.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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 -- cgit v1.2.3